From c5f93055a09629247236d1d7dca2c4aa9c1de7c9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Mar 2018 05:08:35 -0700 Subject: [vcpkg-cmake-toolchain] Only wrap find_package(Boost) if a boost library is installed. --- scripts/buildsystems/vcpkg.cmake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 196ddcb3c..10e3c3f13 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -190,23 +190,13 @@ macro(find_package 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}) - set(_Boost_COMPILER ${Boost_COMPILER}) + elseif("${name}" STREQUAL "Boost" AND EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/boost") + # Checking for the boost headers disables this wrapper unless the user has installed at least one boost library unset(Boost_USE_STATIC_LIBS) unset(Boost_USE_MULTITHREADED) unset(Boost_USE_STATIC_RUNTIME) set(Boost_COMPILER "-vc140") _find_package(${ARGV}) - if(NOT Boost_FOUND) - 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}) - set(Boost_COMPILER ${_Boost_COMPILER}) - _find_package(${ARGV}) - endif() elseif("${name}" STREQUAL "ICU") function(_vcpkg_find_in_list) list(FIND ARGV "COMPONENTS" COMPONENTS_IDX) -- cgit v1.2.3