aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorGraham Bloice <graham.bloice@trihedral.com>2014-05-16 20:43:17 +0100
committerEvan Huus <eapache@gmail.com>2014-06-08 12:13:35 +0000
commit561460160a4ae73bda9b92751ae5c35d4324bb87 (patch)
treed3fad10ea806f0feca51e6560768216cdecb3f6e /cmake
parent39cdb98606b821136aabc6d60b2e1ce4846aab8b (diff)
Update CMake build for win32 to build QT again, and to find
GLib and GThread libs Change-Id: If7e8ebc46f42389d174959303e13cde20687ae8a Reviewed-on: https://code.wireshark.org/review/2010 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindGLIB2.cmake12
-rw-r--r--cmake/modules/FindGTHREAD2.cmake12
-rw-r--r--cmake/modules/FindWSWinLibs.cmake17
3 files changed, 25 insertions, 16 deletions
diff --git a/cmake/modules/FindGLIB2.cmake b/cmake/modules/FindGLIB2.cmake
index 30fd04d45e..a500684949 100644
--- a/cmake/modules/FindGLIB2.cmake
+++ b/cmake/modules/FindGLIB2.cmake
@@ -35,12 +35,6 @@ else()
set( _pkgconfig_REQUIRED "" )
endif()
-if( GLIB2_MIN_VERSION )
- pkg_search_module( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
-else()
- pkg_search_module( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
-endif()
-
find_path( GLIB2_MAIN_INCLUDE_DIR
NAMES
glib.h
@@ -107,5 +101,11 @@ else()
set( GLIB2_MAIN_INCLUDE_DIRS )
endif()
+if( GLIB2_MIN_VERSION )
+ pkg_search_module( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
+else()
+ pkg_search_module( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
+endif()
+
mark_as_advanced( GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES )
diff --git a/cmake/modules/FindGTHREAD2.cmake b/cmake/modules/FindGTHREAD2.cmake
index 182df7c2ab..1e2079bc80 100644
--- a/cmake/modules/FindGTHREAD2.cmake
+++ b/cmake/modules/FindGTHREAD2.cmake
@@ -21,12 +21,6 @@ else()
set( _pkgconfig_REQUIRED "" )
endif()
-if( GTHREAD2_MIN_VERSION )
- PKG_SEARCH_MODULE( GTHREAD2 ${_pkgconfig_REQUIRED} gthread-2.0>=${GTHREAD2_MIN_VERSION} )
-else()
- PKG_SEARCH_MODULE( GTHREAD2 ${_pkgconfig_REQUIRED} gthread-2.0 )
-endif()
-
if( NOT GTHREAD2_FOUND )
include( FindWSWinLibs )
if( BUILD_wireshark )
@@ -48,4 +42,10 @@ if( NOT GTHREAD2_FOUND )
find_package_handle_standard_args( GTHREAD2 DEFAULT_MSG GTHREAD2_LIBRARIES GTHREAD2_INCLUDE_DIRS )
endif()
+if( GTHREAD2_MIN_VERSION )
+ PKG_SEARCH_MODULE( GTHREAD2 ${_pkgconfig_REQUIRED} gthread-2.0>=${GTHREAD2_MIN_VERSION} )
+else()
+ PKG_SEARCH_MODULE( GTHREAD2 ${_pkgconfig_REQUIRED} gthread-2.0 )
+endif()
+
mark_as_advanced( GTHREAD2_LIBRARIES GTHREAD2_INCLUDE_DIRS )
diff --git a/cmake/modules/FindWSWinLibs.cmake b/cmake/modules/FindWSWinLibs.cmake
index 4d970f9ef4..c1ec4b1d9b 100644
--- a/cmake/modules/FindWSWinLibs.cmake
+++ b/cmake/modules/FindWSWinLibs.cmake
@@ -26,14 +26,23 @@ function( FindWSWinLibs _WS_LIB_SEARCH_PATH _LIB_HINT_VAR )
endif()
endfunction()
+# Massage the list of paths to external libraries to output a batch file to update the PATH
+# So that running an executable can load the DLL's
+
function( WSExtendPath _LIB_PATH_LIST _PATH_FILE )
if ( WIN32 )
#message( STATUS "All libs: ${_LIB_PATH_LIST}." )
+ # Convert each path that ends in "lib" to "bin" as linking requires the lib, running requires the dll.
foreach( THIS_LIB_PATH ${_LIB_PATH_LIST} )
- get_filename_component( LIB_PATH ${THIS_LIB_PATH} PATH )
- # lib is required for linking, the dlls are in bin
- string( REGEX REPLACE "/lib$" "/bin" LIB_PATH "${LIB_PATH}" )
- #message( STATUS "Raw path ${THIS_LIB_PATH} processed to ${LIB_PATH}." )
+ if ( THIS_LIB_PATH MATCHES "[.]lib$" )
+ # lib is required for linking, the dlls are in bin so fix the path
+ # by chopping the library off the end and tacking "/bin" on
+ get_filename_component( LIB_PATH ${THIS_LIB_PATH} PATH )
+ string( REGEX REPLACE "/lib$" "/bin" LIB_PATH "${LIB_PATH}" )
+ else()
+ set ( LIB_PATH "${THIS_LIB_PATH}" )
+ endif()
+ #message( STATUS "Raw path ${THIS_LIB_PATH} processed to ${LIB_PATH}" )
set( WS_LOCAL_LIB_PATHS "${WS_LOCAL_LIB_PATHS}" ${LIB_PATH} )
endforeach()
list( REMOVE_DUPLICATES WS_LOCAL_LIB_PATHS )