2 # Find the Sparkle framework
4 # This defines the following:
5 # SPARKLE_FOUND - True if we found Sparkle
6 # SPARKLE_INCLUDE_DIRS - Path to Sparkle.h, empty if not found
7 # SPARKLE_LIBRARIES - Path to Sparkle.framework, empty if not found
8 # SPARKLE_VERSION - Sparkle framework bundle version
10 include(FindPackageHandleStandardArgs)
12 file(GLOB USR_LOCAL_HINT "/usr/local/Sparkle-[2-9]*/")
13 file(GLOB HOMEBREW_HINT "/usr/local/Caskroom/sparkle/[2-9]*/")
15 find_path(SPARKLE_INCLUDE_DIR Sparkle.h
16 HINTS ${USR_LOCAL_HINT} ${HOMEBREW_HINT}
18 find_library(SPARKLE_LIBRARY NAMES Sparkle
19 HINTS ${USR_LOCAL_HINT} ${HOMEBREW_HINT}
22 # Sparkle doesn't appear to provide a version macro, and its Info.plist versions
23 # are all over the place. Check for SPUStandardUpdaterController.h, which was
25 set(SPARKLE_VERSION 1)
27 find_file(_spustandardupdatercontroller_h SPUStandardUpdaterController.h
28 ${SPARKLE_LIBRARY}/Headers
32 if(_spustandardupdatercontroller_h)
33 set(SPARKLE_VERSION 2)
36 unset(_spustandardupdatercontroller_h CACHE)
38 find_package_handle_standard_args(Sparkle
39 REQUIRED_VARS SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY
40 VERSION_VAR SPARKLE_VERSION
44 set(SPARKLE_LIBRARIES ${SPARKLE_LIBRARY} )
45 set(SPARKLE_INCLUDE_DIRS ${SPARKLE_INCLUDE_DIR} )
47 set(SPARKLE_LIBRARIES )
48 set(SPARKLE_INCLUDE_DIRS )
51 mark_as_advanced(SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)