From 42c56485dcfb49d116c06dec8be8b28088a7f4a2 Mon Sep 17 00:00:00 2001 From: jmayer Date: Tue, 28 Sep 2010 19:23:15 +0000 Subject: - Reset a few more variables used in FindXYZ scripts. - README.cmake: small update. - Set a variable before using it for installation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@34274 f5534014-38df-0310-8fa8-9805f1628bb7 --- CMakeLists.txt | 11 +++++++---- README.cmake | 2 -- cmake/modules/CheckCLinkerFlag.cmake | 6 +++--- cmake/modules/FindPCAP.cmake | 3 +++ cmake/modules/FindZLIB.cmake | 2 ++ 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db8b5004e6..ace54185ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,6 +223,9 @@ endif() #The minimum package list set(PACKAGELIST GLIB2 GMODULE2 PCAP M LEX YACC Perl SH PythonInterp HtmlViewer ${PACKAGELIST}) +set(GLIB2_FIND_REQUIRED) +set(GLIB2_MIN_VERSION 2.4.0) + #Build the gui ? if(BUILD_wireshark) set(PACKAGELIST GTK2 ${PACKAGELIST}) @@ -397,6 +400,10 @@ add_subdirectory( tools/lemon ) add_subdirectory( wiretap ) add_subdirectory( wsutil ) +# Basedir where to install guides +set(DOC_DIR "$ENV{docdir}") +message(STATUS "docdir: ${DOC_DIR}") + if(ENABLE_GUIDES) add_subdirectory( docbook ) endif() @@ -427,10 +434,6 @@ endif() configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h) -# Basedir where to install guides -set(DOC_DIR "$ENV{docdir}") -message(STATUS "docdir: ${DOC_DIR}") - include(FeatureSummary) #SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ] PRINT_ENABLED_FEATURES() diff --git a/README.cmake b/README.cmake index 566d8bd311..86874b3ac9 100644 --- a/README.cmake +++ b/README.cmake @@ -82,8 +82,6 @@ What needs to be done? - Add asn1 autogen target (assigned: krj) - Redo glib2 find modules. Add version detection while at it. -- Change default for PCRE to off and use GLIB2 regexes by default. - This requires the redone glib2 detection module. - Add back platform specific objects. - Fix places in the cmake files marked as todo. - Add back (working) install target. diff --git a/cmake/modules/CheckCLinkerFlag.cmake b/cmake/modules/CheckCLinkerFlag.cmake index aa346684f7..abe4a3a283 100644 --- a/cmake/modules/CheckCLinkerFlag.cmake +++ b/cmake/modules/CheckCLinkerFlag.cmake @@ -12,12 +12,12 @@ # # Redistribution and use is allowed according to the terms of the BSD license. -INCLUDE(CheckCSourceCompiles) +INCLUDE(CheckCSourceRuns) MACRO (CHECK_C_LINKER_FLAG _FLAG _RESULT) SET(CMAKE_REQUIRED_FLAGS "${_FLAG}") message(status "check linker flag - test linker flags: ${CMAKE_REQUIRED_FLAGS}") - CHECK_C_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}) - SET(CMAKE_REQUIRED_FLAGS " ") + CHECK_C_SOURCE_RUNS("int main() { return 0;}" ${_RESULT}) + SET(CMAKE_REQUIRED_FLAGS "") ENDMACRO (CHECK_C_LINKER_FLAG) diff --git a/cmake/modules/FindPCAP.cmake b/cmake/modules/FindPCAP.cmake index 1ec01c95c6..d22f0ba951 100644 --- a/cmake/modules/FindPCAP.cmake +++ b/cmake/modules/FindPCAP.cmake @@ -120,6 +120,9 @@ CHECK_FUNCTION_EXISTS("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) CHECK_FUNCTION_EXISTS("pcap_lib_version" HAVE_PCAP_LIB_VERSION) CHECK_FUNCTION_EXISTS("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) CHECK_FUNCTION_EXISTS("pcap_free_datalinks" HAVE_PCAP_FREE_DATALINKS) +# reset vars +SET(CMAKE_REQUIRED_INCLUDES "") +SET(CMAKE_REQUIRED_LIBRARIES "") INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES) diff --git a/cmake/modules/FindZLIB.cmake b/cmake/modules/FindZLIB.cmake index 5f8f24b587..316f9e5115 100644 --- a/cmake/modules/FindZLIB.cmake +++ b/cmake/modules/FindZLIB.cmake @@ -38,6 +38,8 @@ SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}") INCLUDE(CheckFunctionExists) SET(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) CHECK_FUNCTION_EXISTS("gzclearerr" HAVE_GZCLEARERR) +# reset +SET(CMAKE_REQUIRED_LIBRARIES "") # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if # all listed variables are TRUE -- cgit v1.2.3