summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Bloice <graham.bloice@trihedral.com>2014-08-20 22:29:33 +0100
committerGraham Bloice <graham.bloice@trihedral.com>2014-08-22 22:04:33 +0000
commit06565a742411b3d5307cab70a85d5f196073eb90 (patch)
tree747a4255c35e0344d7661ec7c52d490b715180ea
parent863b6646d6995b7f0a7c70aad845c7bb3f00dbc7 (diff)
downloadwireshark-06565a742411b3d5307cab70a85d5f196073eb90.tar.gz
Add WinSparkle to the CMake build to bring it into line with
the nmake build Change-Id: I944d0fe15b396cad4d0054b6fc359acb42ae3c9c Reviewed-on: https://code.wireshark.org/review/3755 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
-rw-r--r--CMakeLists.txt11
-rw-r--r--CMakeOptions.txt5
-rw-r--r--cmake/modules/FindWinSparkle.cmake35
-rw-r--r--cmakeconfig.h.in3
4 files changed, 54 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 154f0ae169..299ddffa20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -595,6 +595,11 @@ if(ENABLE_CAP)
set(PACKAGELIST ${PACKAGELIST} CAP SETCAP)
endif()
+# Windows version updates
+if(ENABLE_WINSPARKLE)
+ set(PACKAGELIST ${PACKAGELIST} WINSPARKLE)
+endif()
+
set(PACKAGELIST ${PACKAGELIST} YAPP)
set(PACKAGELIST ${PACKAGELIST} POD)
@@ -694,6 +699,11 @@ endif()
if(HAVE_LIBSBC)
set(HAVE_SBC 1)
endif()
+
+if (HAVE_LIBWINSPARKLE)
+ set(HAVE_SOFTWARE_UPDATE 1)
+endif()
+
# No matter which version of GTK is present
if(GTK2_FOUND OR GTK3_FOUND)
set(GTK_FOUND ON)
@@ -1063,6 +1073,7 @@ set(LIBEPAN_LIBS
${ZLIB_LIBRARIES}
${M_LIBRARIES}
${SBC_LIBRARIES}
+ ${WINSPARKLE_LIBRARIES}
)
if( (BUILD_wireshark AND GTK_FOUND) OR (BUILD_qtshark AND QT_FOUND) )
diff --git a/CMakeOptions.txt b/CMakeOptions.txt
index 75e61658aa..6bf542de6c 100644
--- a/CMakeOptions.txt
+++ b/CMakeOptions.txt
@@ -56,6 +56,11 @@ option(ENABLE_SMI "Build with libsmi snmp support" ON)
option(ENABLE_GNUTLS "Build with GNU TLS support" ON)
option(ENABLE_GCRYPT "Build with GNU crypto support" ON)
option(ENABLE_GEOIP "Build with GeoIP support" ON)
+if(WIN32)
+ option(ENABLE_WINSPARKLE "Enable WinSparkle support" ON)
+else()
+ option(ENABLE_WINSPARKLE "Enable WinSparkle support" OFF)
+endif()
option(ENABLE_CAP "Build with Posix capabilities support" ON)
option(ENABLE_CARES "Build with c-ares support" ON)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff --git a/cmake/modules/FindWinSparkle.cmake b/cmake/modules/FindWinSparkle.cmake
new file mode 100644
index 0000000000..8680b1a648
--- /dev/null
+++ b/cmake/modules/FindWinSparkle.cmake
@@ -0,0 +1,35 @@
+#
+# - 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.
+
+
+IF (WINSPARKLE_INCLUDE_DIRS)
+ # Already in cache, be silent
+ SET(WINSPARKLE_FIND_QUIETLY TRUE)
+ENDIF (WINSPARKLE_INCLUDE_DIRS)
+
+INCLUDE(FindWSWinLibs)
+FindWSWinLibs("WinSparkle-.*" "WINSPARKLE_HINTS")
+
+FIND_PATH(WINSPARKLE_INCLUDE_DIR winsparkle.h HINTS "${WINSPARKLE_HINTS}" )
+
+FIND_LIBRARY(WINSPARKLE_LIBRARY NAMES WinSparkle HINTS "${WINSPARKLE_HINTS}" )
+
+# 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} )
+ELSE(WINSPARKLE_FOUND)
+ SET(WINSPARKLE_LIBRARIES )
+ SET(WINSPARKLE_INCLUDE_DIRS )
+ENDIF(WINSPARKLE_FOUND)
+
+MARK_AS_ADVANCED( WINSPARKLE_LIBRARIES WINSPARKLE_INCLUDE_DIRS )
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index b2b8829124..5265de4ca2 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -257,6 +257,9 @@
/* Define to 1 if you have the `setresuid' function. */
#cmakedefine HAVE_SETRESUID 1
+/* Define to 1 if you have the WinSparkle library */
+#cmakedefine HAVE_SOFTWARE_UPDATE 1
+
/* Define to 1 if you have the <stdarg.h> header file. */
#cmakedefine HAVE_STDARG_H 1