aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2022-01-12 12:00:42 -0800
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-01-13 09:11:24 +0000
commita6e24a623416ca08fc8c3bb339b4f275a6aa9c3d (patch)
tree12d4168d992879fda42e8b0992af02a691072ddd /cmake
parent5074b4d71791b6240829b53cf80c66c9f8ca7835 (diff)
macOS: Require Sparkle 1 for now.
The Sparkle project recently released Sparkle 2.0.0, which deprecates the version 1 API. Add version discovery to FindSparkle.cmake and require version 1 until we add support for the new API. Ping #17861.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindSparkle.cmake21
1 files changed, 20 insertions, 1 deletions
diff --git a/cmake/modules/FindSparkle.cmake b/cmake/modules/FindSparkle.cmake
index 5c14080d08..a06ebdc2be 100644
--- a/cmake/modules/FindSparkle.cmake
+++ b/cmake/modules/FindSparkle.cmake
@@ -5,6 +5,7 @@
# SPARKLE_FOUND - True if we found Sparkle
# SPARKLE_INCLUDE_DIRS - Path to Sparkle.h, empty if not found
# SPARKLE_LIBRARIES - Path to Sparkle.framework, empty if not found
+# SPARKLE_VERSION - Sparkle framework bundle version
include(FindPackageHandleStandardArgs)
@@ -18,7 +19,25 @@ find_library(SPARKLE_LIBRARY NAMES Sparkle
HINTS ${USR_LOCAL_HINT} ${HOMEBREW_HINT}
)
-find_package_handle_standard_args(Sparkle DEFAULT_MSG SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)
+# https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html
+find_file(_info_plist Info.plist
+ ${SPARKLE_LIBRARY}/Resources
+ ${SPARKLE_LIBRARY}/Versions/Current/Resources
+ ${SPARKLE_LIBRARY}/Versions/A/Resources
+ NO_DEFAULT_PATH
+)
+
+if(_info_plist)
+ execute_process(COMMAND defaults read ${_info_plist} CFBundleVersion
+ OUTPUT_VARIABLE SPARKLE_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+endif()
+
+find_package_handle_standard_args(Sparkle
+ REQUIRED_VARS SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY
+ VERSION_VAR SPARKLE_VERSION
+)
if(SPARKLE_FOUND)
set(SPARKLE_LIBRARIES ${SPARKLE_LIBRARY} )