decrypt drsuapi attributes
[wireshark-sm.git] / cmake / modules / FindSparkle.cmake
blob1969c02d15d52f231f92e3caf5d7ed6b5ebf13ff
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
24 # added in version 2.
25 set(SPARKLE_VERSION 1)
27 find_file(_spustandardupdatercontroller_h SPUStandardUpdaterController.h
28   ${SPARKLE_LIBRARY}/Headers
29   NO_DEFAULT_PATH
32 if(_spustandardupdatercontroller_h)
33   set(SPARKLE_VERSION 2)
34 endif()
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
43 if(SPARKLE_FOUND)
44   set(SPARKLE_LIBRARIES ${SPARKLE_LIBRARY} )
45   set(SPARKLE_INCLUDE_DIRS ${SPARKLE_INCLUDE_DIR} )
46 else(SPARKLE_FOUND)
47   set(SPARKLE_LIBRARIES )
48   set(SPARKLE_INCLUDE_DIRS )
49 endif(SPARKLE_FOUND)
51 mark_as_advanced(SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)