summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindWinSparkle.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /cmake/modules/FindWinSparkle.cmake
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindWinSparkle.cmake')
-rw-r--r--cmake/modules/FindWinSparkle.cmake56
1 files changed, 56 insertions, 0 deletions
diff --git a/cmake/modules/FindWinSparkle.cmake b/cmake/modules/FindWinSparkle.cmake
new file mode 100644
index 0000000..7418cfb
--- /dev/null
+++ b/cmake/modules/FindWinSparkle.cmake
@@ -0,0 +1,56 @@
+#
+# - Find WinSparkle
+# Find the native WinSparkle includes and library
+#
+# WINSPARKLE_INCLUDE_DIRS - where to find WinSparkle.h, etc.
+# WINSPARKLE_LIBRARIES - List of libraries when using WinSparkle.
+# WINSPARKLE_FOUND - True if WinSparkle found.
+# WINSPARKLE_DLL_DIR - (Windows) Path to the WinSparkle DLL.
+# WINSPARKLE_DLL - (Windows) Name of the WinSparkle DLL.
+
+
+IF (WINSPARKLE_INCLUDE_DIRS)
+ # Already in cache, be silent
+ SET(WINSPARKLE_FIND_QUIETLY TRUE)
+ENDIF (WINSPARKLE_INCLUDE_DIRS)
+
+INCLUDE(FindWSWinLibs)
+FindWSWinLibs("WinSparkle.*" "WINSPARKLE_HINTS")
+
+set (_release_subdir "${WIRESHARK_TARGET_PLATFORM}/Release")
+
+FIND_PATH(WINSPARKLE_INCLUDE_DIR winsparkle.h HINTS "${WINSPARKLE_HINTS}/include" )
+
+FIND_LIBRARY(WINSPARKLE_LIBRARY NAMES WinSparkle HINTS "${WINSPARKLE_HINTS}/${_release_subdir}" )
+
+# handle the QUIETLY and REQUIRED arguments and set WINSPARKLE_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(WinSparkle DEFAULT_MSG WINSPARKLE_LIBRARY WINSPARKLE_INCLUDE_DIR)
+
+IF(WINSPARKLE_FOUND)
+ SET(WINSPARKLE_LIBRARIES ${WINSPARKLE_LIBRARY} )
+ SET(WINSPARKLE_INCLUDE_DIRS ${WINSPARKLE_INCLUDE_DIR} )
+ if (WIN32)
+ set (WINSPARKLE_DLL_DIR "${WINSPARKLE_HINTS}/${_release_subdir}"
+ CACHE PATH "Path to the WinSparkle DLL"
+ )
+ file( GLOB _winsparkle_dll RELATIVE "${WINSPARKLE_DLL_DIR}"
+ "${WINSPARKLE_DLL_DIR}/WinSparkle.dll"
+ )
+ set ( WINSPARKLE_DLL ${_winsparkle_dll}
+ # We're storing filenames only. Should we use STRING instead?
+ CACHE FILEPATH "WinSparkle DLL file name"
+ )
+ mark_as_advanced( WINSPARKLE_DLL_DIR WINSPARKLE_DLL )
+ endif()
+ELSE(WINSPARKLE_FOUND)
+ SET(WINSPARKLE_LIBRARIES )
+ SET(WINSPARKLE_INCLUDE_DIRS )
+ SET(WINSPARKLE_DLL_DIR )
+ SET(WINSPARKLE_DLL )
+ENDIF(WINSPARKLE_FOUND)
+
+unset(_release_subdir)
+
+MARK_AS_ADVANCED( WINSPARKLE_LIBRARIES WINSPARKLE_INCLUDE_DIRS )