diff options
Diffstat (limited to 'scripts/buildsystems')
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index ce5efc1de..10e3c3f13 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -57,12 +57,14 @@ endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") set(_VCPKG_TARGET_TRIPLET_PLAT uwp) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")) set(_VCPKG_TARGET_TRIPLET_PLAT linux) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")) set(_VCPKG_TARGET_TRIPLET_PLAT osx) -else() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")) set(_VCPKG_TARGET_TRIPLET_PLAT windows) +elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR (NOT CMAKE_SYSTEM_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")) + set(_VCPKG_TARGET_TRIPLET_PLAT freebsd) endif() set(VCPKG_TARGET_TRIPLET ${_VCPKG_TARGET_TRIPLET_ARCH}-${_VCPKG_TARGET_TRIPLET_PLAT} CACHE STRING "Vcpkg target triplet (ex. x86-windows)") @@ -184,23 +186,17 @@ function(add_library name) endfunction() macro(find_package name) - if("${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}) + 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" 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) |
