diff options
author | Gerald Combs <gerald@wireshark.org> | 2022-04-09 14:14:04 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2022-04-18 18:57:43 +0000 |
commit | fea6591b0c84660f46c06029e664e2a9af18fe87 (patch) | |
tree | f4192581b2ebb181e668dc52781f9ae39c362ce7 /cmake/modules/FindSparkle.cmake | |
parent | c8d9c6fc6a92d83c34160b8c4490f6495d57f605 (diff) |
macOS: Add support for Sparkle 2.
Sparkle 2 deprecated the sharedUpdater singleton, so create our own
which uses Sparkle 2's updated API. Ping #18035.
Update our CMake version check.
Diffstat (limited to 'cmake/modules/FindSparkle.cmake')
-rw-r--r-- | cmake/modules/FindSparkle.cmake | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/cmake/modules/FindSparkle.cmake b/cmake/modules/FindSparkle.cmake index a06ebdc2be..e552c33e31 100644 --- a/cmake/modules/FindSparkle.cmake +++ b/cmake/modules/FindSparkle.cmake @@ -19,19 +19,18 @@ find_library(SPARKLE_LIBRARY NAMES Sparkle HINTS ${USR_LOCAL_HINT} ${HOMEBREW_HINT} ) -# 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 +# Sparkle doesn't appear to provide a version macro, and its Info.plist versions +# are all over the place. Check for SPUStandardUpdaterController.h, which was +# added in version 2. +set(SPARKLE_VERSION 1) + +find_file(_spustandardupdatercontroller_h SPUStandardUpdaterController.h + ${SPARKLE_LIBRARY}/Headers NO_DEFAULT_PATH ) -if(_info_plist) - execute_process(COMMAND defaults read ${_info_plist} CFBundleVersion - OUTPUT_VARIABLE SPARKLE_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) +if(_spustandardupdatercontroller_h) + set(SPARKLE_VERSION 2) endif() find_package_handle_standard_args(Sparkle |