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 # The 64-bit wpcap.lib is under /x64/Release
21 set ( _RELEASE_SUBDIR "Release" )
22 if( WIN32 AND "${WIRESHARK_TARGET_PLATFORM}" STREQUAL "win64" )
23 set ( _RELEASE_SUBDIR "x64/Release" )
26 FIND_PATH(WINSPARKLE_INCLUDE_DIR winsparkle.h HINTS "${WINSPARKLE_HINTS}/include" )
28 FIND_LIBRARY(WINSPARKLE_LIBRARY NAMES WinSparkle HINTS "${WINSPARKLE_HINTS}/${_RELEASE_SUBDIR}" )
30 # handle the QUIETLY and REQUIRED arguments and set WINSPARKLE_FOUND to TRUE if
31 # all listed variables are TRUE
32 INCLUDE(FindPackageHandleStandardArgs)
33 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WINSPARKLE DEFAULT_MSG WINSPARKLE_LIBRARY WINSPARKLE_INCLUDE_DIR)
36 SET(WINSPARKLE_LIBRARIES ${WINSPARKLE_LIBRARY} )
37 SET(WINSPARKLE_INCLUDE_DIRS ${WINSPARKLE_INCLUDE_DIR} )
39 set ( WINSPARKLE_DLL_DIR "${WINSPARKLE_HINTS}/${_RELEASE_SUBDIR}"
40 CACHE PATH "Path to the WinSparkle DLL"
42 file( GLOB _winsparkle_dll RELATIVE "${WINSPARKLE_DLL_DIR}"
43 "${WINSPARKLE_DLL_DIR}/WinSparkle.dll"
45 set ( WINSPARKLE_DLL ${_winsparkle_dll}
46 # We're storing filenames only. Should we use STRING instead?
47 CACHE FILEPATH "WinSparkle DLL file name"
49 mark_as_advanced( WINSPARKLE_DLL_DIR WINSPARKLE_DLL )
51 ELSE(WINSPARKLE_FOUND)
52 SET(WINSPARKLE_LIBRARIES )
53 SET(WINSPARKLE_INCLUDE_DIRS )
54 SET(WINSPARKLE_DLL_DIR )
56 ENDIF(WINSPARKLE_FOUND)
58 MARK_AS_ADVANCED( WINSPARKLE_LIBRARIES WINSPARKLE_INCLUDE_DIRS )