[vcpkg-cmake] Add tools subdirectories to the find programs path. Improves #1143.

This commit is contained in:
Robert Schumacher 2017-06-09 22:38:17 -07:00
parent 2e01b926d8
commit 13b29588ba

View File

@ -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)