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 header file. */ #cmakedefine HAVE_STDARG_H 1