[vcpkg] Enable packages to provide cmake wrapper scripts.

This commit is contained in:
Robert Schumacher 2018-03-11 23:04:09 -07:00
parent 7aaa59fc9d
commit 4338ae25a1

View File

@ -184,7 +184,11 @@ function(add_library name)
endfunction()
macro(find_package name)
if("${name}" STREQUAL "Boost")
string(TOLOWER "${name}" _vcpkg_lowercase_name)
if(EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake")
set(ARGS "${ARGV}")
include(${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/${_vcpkg_lowercase_name}/vcpkg-cmake-wrapper.cmake)
elseif("${name}" STREQUAL "Boost")
set(_Boost_USE_STATIC_LIBS ${Boost_USE_STATIC_LIBS})
set(_Boost_USE_MULTITHREADED ${Boost_USE_MULTITHREADED})
set(_Boost_USE_STATIC_RUNTIME ${Boost_USE_STATIC_RUNTIME})