aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2014-10-20 16:11:48 -0700
committerGerald Combs <gerald@wireshark.org>2014-10-20 23:42:11 +0000
commita19825b45dad112edfa565369d8d31a36bf47817 (patch)
tree09a4a2414dcae3beaedbfb13e09b9fac0c5b943e /cmake
parentf66e45b112cd283698996cc72bc659b9715ff5ef (diff)
CMake: Use WIRESHARK_LIB_DIR. Fix GThread check on Windows.
Have FindWSWinLibs check for WIRESHARK_LIB_DIR before WIRESHARK_BASE_DIR to match the behavior of config.nmake and the Windows buildbots, which set the former but not the latter. It looks like the latest GLib DLL contains GThread. Adjust FindGTHREAD2.cmake accordingly. Change-Id: I0232b1819eca9ba2c39ae6834daddf65af979d7d Reviewed-on: https://code.wireshark.org/review/4887 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindGTHREAD2.cmake13
-rw-r--r--cmake/modules/FindWSWinLibs.cmake11
2 files changed, 17 insertions, 7 deletions
diff --git a/cmake/modules/FindGTHREAD2.cmake b/cmake/modules/FindGTHREAD2.cmake
index 228236a7ab..417e25c32d 100644
--- a/cmake/modules/FindGTHREAD2.cmake
+++ b/cmake/modules/FindGTHREAD2.cmake
@@ -38,10 +38,15 @@ else()
endif()
find_path( GTHREAD2_INCLUDE_DIRS gthread.h PATH_SUFFIXES glib-2.0 glib GLib.framework/Headers/glib glib-2.0/glib HINTS "${GTHREAD2_HINTS}/include" )
find_library( GTHREAD2_LIBRARIES gthread-2.0 HINTS "${GTHREAD2_HINTS}/lib" )
- if( NOT GTHREAD2_LIBRARIES AND APPLE )
- # Fallback as APPLE glib libs already contain this - except
- # Homebrew which needs the non-Apple setup
- find_library( GTHREAD2_LIBRARIES glib )
+ if( NOT GTHREAD2_LIBRARIES )
+ # GLib contains GThread in some cases.
+ if( APPLE )
+ # Fallback as APPLE glib libs already contain this - except
+ # Homebrew which needs the non-Apple setup
+ find_library( GTHREAD2_LIBRARIES glib )
+ elseif( WIN32 )
+ find_library( GTHREAD2_LIBRARIES glib-2.0 HINTS "${GTHREAD2_HINTS}/lib" )
+ endif()
endif()
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( GTHREAD2 DEFAULT_MSG GTHREAD2_LIBRARIES GTHREAD2_INCLUDE_DIRS )
diff --git a/cmake/modules/FindWSWinLibs.cmake b/cmake/modules/FindWSWinLibs.cmake
index c1ec4b1d9b..828cb8b63d 100644
--- a/cmake/modules/FindWSWinLibs.cmake
+++ b/cmake/modules/FindWSWinLibs.cmake
@@ -11,9 +11,14 @@ function( FindWSWinLibs _WS_LIB_SEARCH_PATH _LIB_HINT_VAR )
if( ARGN )
set( _PROJECT_LIB_DIR ${ARGN} )
else()
- file( TO_CMAKE_PATH "$ENV{WIRESHARK_BASE_DIR}" _WS_BASE_DIR )
- set( _WS_TARGET_PLATFORM $ENV{WIRESHARK_TARGET_PLATFORM} )
- set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${_WS_TARGET_PLATFORM}-libs" )
+ if( DEFINED ENV{WIRESHARK_LIB_DIR} )
+ # The buildbots set WIRESHARK_LIB_DIR but not WIRESHARK_BASE_DIR.
+ file( TO_CMAKE_PATH "$ENV{WIRESHARK_LIB_DIR}" _PROJECT_LIB_DIR )
+ else()
+ file( TO_CMAKE_PATH "$ENV{WIRESHARK_BASE_DIR}" _WS_BASE_DIR )
+ set( _WS_TARGET_PLATFORM $ENV{WIRESHARK_TARGET_PLATFORM} )
+ set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${_WS_TARGET_PLATFORM}-libs" )
+ endif()
endif()
file( GLOB _SUBDIR "${_PROJECT_LIB_DIR}/*" )
foreach( _DIR ${_SUBDIR} )