2013-09-23 21:45:55 +00:00
|
|
|
#
|
|
|
|
# - Find WSWin Libs
|
|
|
|
# Due to the layout of the Wireshark Win support libs,
|
|
|
|
# CMake needs some support to find them
|
|
|
|
#
|
|
|
|
# The function is passed the directory name to search for and the variable
|
|
|
|
# to set in the callers scope.
|
|
|
|
|
2013-10-11 07:38:45 +00:00
|
|
|
function( FindWSWinLibs _WS_LIB_SEARCH_PATH _LIB_HINT_VAR )
|
|
|
|
if( WIN32 )
|
|
|
|
if( ARGN )
|
|
|
|
set( _PROJECT_LIB_DIR ${ARGN} )
|
|
|
|
else()
|
2014-10-20 23:11:48 +00:00
|
|
|
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 )
|
2017-06-05 15:03:52 +00:00
|
|
|
set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${WIRESHARK_TARGET_PLATFORM}-libs" )
|
2014-10-20 23:11:48 +00:00
|
|
|
endif()
|
2013-10-11 07:38:45 +00:00
|
|
|
endif()
|
2019-01-17 22:32:33 +00:00
|
|
|
|
2013-09-23 21:45:55 +00:00
|
|
|
file( GLOB _SUBDIR "${_PROJECT_LIB_DIR}/*" )
|
2019-01-17 22:32:33 +00:00
|
|
|
# We might be able to use $ENV{VSCMD_ARG_TGT_ARCH} here.
|
|
|
|
set (_vcpkg_arch x64)
|
|
|
|
if(WIRESHARK_TARGET_PLATFORM MATCHES "win32")
|
|
|
|
set (_vcpkg_arch x86)
|
|
|
|
endif()
|
|
|
|
|
2013-09-23 21:45:55 +00:00
|
|
|
foreach( _DIR ${_SUBDIR} )
|
2013-09-27 22:30:34 +00:00
|
|
|
if( IS_DIRECTORY ${_DIR} )
|
|
|
|
if( "${_DIR}" MATCHES ".*/${_WS_LIB_SEARCH_PATH}" )
|
2019-01-17 22:32:33 +00:00
|
|
|
set(_vcpkg_dir "${_DIR}/installed/${_vcpkg_arch}-windows")
|
2019-01-04 18:14:13 +00:00
|
|
|
if( IS_DIRECTORY "${_vcpkg_dir}")
|
|
|
|
set( ${_LIB_HINT_VAR} ${_vcpkg_dir} PARENT_SCOPE )
|
|
|
|
else()
|
|
|
|
set( ${_LIB_HINT_VAR} ${_DIR} PARENT_SCOPE )
|
|
|
|
endif()
|
2013-09-23 21:45:55 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2013-10-10 13:37:15 +00:00
|
|
|
endfunction()
|