From 0eee62affe9e6b935fdc37a0d72d5c27c5c7651a Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 5 Aug 2016 15:39:26 -0700 Subject: CMake: Look for vcredist_x??.exe in more places. Look for the redistributable installer in the project library directory before %VCINSTALLDIR%. This lets us ship a specific version of the redistributable. Change-Id: I70e5aa90ac5addba5355d1964aeb50e277d1a8d4 Ping-Bug: 12712 Reviewed-on: https://code.wireshark.org/review/16922 Reviewed-by: Gerald Combs Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- packaging/nsis/CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'packaging') diff --git a/packaging/nsis/CMakeLists.txt b/packaging/nsis/CMakeLists.txt index 4072771c5b..ceef2575f7 100644 --- a/packaging/nsis/CMakeLists.txt +++ b/packaging/nsis/CMakeLists.txt @@ -90,11 +90,21 @@ if(BUILD_wireshark_gtk AND GTK_FOUND) set (GTK_DIR "\${STAGING_DIR}") endif() -# Use the vcredist that comes with Visual Studio (From MSVC 2013?) +# Look for the Visual C++ Redistributable packages in the following locations: +# - _PROJECT_LIB_DIR +# - _PROJECT_LIB_DIR/vcredist_MSVCxx +# - %VCINSTALLDIR% +# - %VCINSTALLDIR%/redist/1033 set(_vcredist_name "vcredist_${TARGET_MACHINE}.exe") +if(MSVC14) + set(_vcredist_subdir "vcredist_MSVC2015") +elseif(MSVC12) + set(_vcredist_subdir "vcredist_MSVC2013") +endif() + find_program(VCREDIST_EXE "${_vcredist_name}" - PATHS ENV "VCINSTALLDIR" - PATH_SUFFIXES "redist/1033" + PATHS "${_PROJECT_LIB_DIR}" ENV "VCINSTALLDIR" + PATH_SUFFIXES ${_vcredist_subdir} "redist/1033" ) if(VCREDIST_EXE) file(TO_NATIVE_PATH "${VCREDIST_EXE}" VCREDIST_EXE) -- cgit v1.2.1