From 13b29588ba5c1b89969a3bf2a5cc61a97e9c83a0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 9 Jun 2017 22:38:17 -0700 Subject: [PATCH] [vcpkg-cmake] Add tools subdirectories to the find programs path. Improves #1143. --- scripts/buildsystems/vcpkg.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index d3e1e814af..513c33ecba 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -1,6 +1,5 @@ # Mark variables as used so cmake doesn't complain about them set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE}) - if(NOT VCPKG_TOOLCHAIN) if(CMAKE_GENERATOR_PLATFORM MATCHES "^[Ww][Ii][Nn]32$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) @@ -55,7 +54,6 @@ if(NOT VCPKG_TOOLCHAIN) endif() endwhile() set(_VCPKG_ROOT_DIR ${_VCPKG_ROOT_DIR_CANDIDATE}) - set(_VCPKG_INSTALLED_DIR ${_VCPKG_ROOT_DIR}/installed) if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) @@ -103,6 +101,12 @@ if(NOT VCPKG_TOOLCHAIN) ) set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools) + file(GLOB _VCPKG_TOOLS_DIRS ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/*) + foreach(_VCPKG_TOOLS_DIR ${_VCPKG_TOOLS_DIRS}) + if(IS_DIRECTORY ${_VCPKG_TOOLS_DIR}) + set(CMAKE_PROGRAM_PATH ${CMAKE_PROGRAM_PATH} ${_VCPKG_TOOLS_DIR}) + endif() + endforeach() option(VCPKG_APPLOCAL_DEPS "Automatically copy dependencies into the output directory for executables." ON) function(add_executable name)