aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2019-01-17 14:32:33 -0800
committerPeter Wu <peter@lekensteyn.nl>2019-01-18 01:11:06 +0000
commitb14b048a5e15baf6c3edd589097ad8f0f118f579 (patch)
tree236c3c6d1b1d1b46db6281735fddbdc9e104e8f5
parentec17f616475d5554c363f6f67fd70d23007467b7 (diff)
CMake: Fix Vcpkg x86 directory discovery.
`vcpkg export` installs files into an architecture-dependent subdirectory which matches the PLATFORM environment variable on 64-bit Windows but not 32-bit Windows. Replace $ENV{PLATFORM} in FindWSWinLibs with a variable derived from WIRESHARK_TARGET_PLATFORM. Change-Id: I142615bd50179fdffdebd2bb1f193ef0070c0483 Reviewed-on: https://code.wireshark.org/review/31582 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r--cmake/modules/FindWSWinLibs.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmake/modules/FindWSWinLibs.cmake b/cmake/modules/FindWSWinLibs.cmake
index ce4bceba7f..75568d49d8 100644
--- a/cmake/modules/FindWSWinLibs.cmake
+++ b/cmake/modules/FindWSWinLibs.cmake
@@ -19,11 +19,18 @@ function( FindWSWinLibs _WS_LIB_SEARCH_PATH _LIB_HINT_VAR )
set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${WIRESHARK_TARGET_PLATFORM}-libs" )
endif()
endif()
+
file( GLOB _SUBDIR "${_PROJECT_LIB_DIR}/*" )
+ # 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()
+
foreach( _DIR ${_SUBDIR} )
if( IS_DIRECTORY ${_DIR} )
if( "${_DIR}" MATCHES ".*/${_WS_LIB_SEARCH_PATH}" )
- set(_vcpkg_dir "${_DIR}/installed/$ENV{PLATFORM}-windows")
+ set(_vcpkg_dir "${_DIR}/installed/${_vcpkg_arch}-windows")
if( IS_DIRECTORY "${_vcpkg_dir}")
set( ${_LIB_HINT_VAR} ${_vcpkg_dir} PARENT_SCOPE )
else()