3 # Find the native WinSparkle includes and library
5 # WINSPARKLE_INCLUDE_DIRS - where to find WinSparkle.h, etc.
6 # WINSPARKLE_LIBRARIES - List of libraries when using WinSparkle.
7 # WINSPARKLE_FOUND - True if WinSparkle found.
8 # WINSPARKLE_DLL_DIR - (Windows) Path to the WinSparkle DLL.
9 # WINSPARKLE_DLL - (Windows) Name of the WinSparkle DLL.
12 IF (WINSPARKLE_INCLUDE_DIRS)
13 # Already in cache, be silent
14 SET(WINSPARKLE_FIND_QUIETLY TRUE)
15 ENDIF (WINSPARKLE_INCLUDE_DIRS)
17 INCLUDE(FindWSWinLibs)
18 FindWSWinLibs("WinSparkle.*" "WINSPARKLE_HINTS")
20 set (_release_subdir "${WIRESHARK_TARGET_PLATFORM}/Release")
22 FIND_PATH(WINSPARKLE_INCLUDE_DIR winsparkle.h HINTS "${WINSPARKLE_HINTS}/include" )
24 FIND_LIBRARY(WINSPARKLE_LIBRARY NAMES WinSparkle HINTS "${WINSPARKLE_HINTS}/${_release_subdir}" )
26 # handle the QUIETLY and REQUIRED arguments and set WINSPARKLE_FOUND to TRUE if
27 # all listed variables are TRUE
28 INCLUDE(FindPackageHandleStandardArgs)
29 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WinSparkle DEFAULT_MSG WINSPARKLE_LIBRARY WINSPARKLE_INCLUDE_DIR)
32 SET(WINSPARKLE_LIBRARIES ${WINSPARKLE_LIBRARY} )
33 SET(WINSPARKLE_INCLUDE_DIRS ${WINSPARKLE_INCLUDE_DIR} )
35 set (WINSPARKLE_DLL_DIR "${WINSPARKLE_HINTS}/${_release_subdir}"
36 CACHE PATH "Path to the WinSparkle DLL"
38 file( GLOB _winsparkle_dll RELATIVE "${WINSPARKLE_DLL_DIR}"
39 "${WINSPARKLE_DLL_DIR}/WinSparkle.dll"
41 set ( WINSPARKLE_DLL ${_winsparkle_dll}
42 # We're storing filenames only. Should we use STRING instead?
43 CACHE FILEPATH "WinSparkle DLL file name"
45 mark_as_advanced( WINSPARKLE_DLL_DIR WINSPARKLE_DLL )
47 ELSE(WINSPARKLE_FOUND)
48 SET(WINSPARKLE_LIBRARIES )
49 SET(WINSPARKLE_INCLUDE_DIRS )
50 SET(WINSPARKLE_DLL_DIR )
52 ENDIF(WINSPARKLE_FOUND)
54 unset(_release_subdir)
56 MARK_AS_ADVANCED( WINSPARKLE_LIBRARIES WINSPARKLE_INCLUDE_DIRS )