From d91644d3f5dc027f0f2a6a2461f9d5e282f8c264 Mon Sep 17 00:00:00 2001 From: Thad House Date: Wed, 24 Apr 2019 16:13:16 -0700 Subject: [PATCH] Add support for CMake generation with VS 2019 (#6090) --- scripts/buildsystems/vcpkg.cmake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index b2a5894218..10e8bd75e4 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -37,6 +37,18 @@ else() set(_VCPKG_TARGET_TRIPLET_ARCH arm) elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 15 2017$") set(_VCPKG_TARGET_TRIPLET_ARCH x86) + elseif(CMAKE_GENERATOR MATCHES "^Visual Studio 16 2019$") + if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[Xx]86$") + set(_VCPKG_TARGET_TRIPLET_ARCH x86) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[Aa][Mm][Dd]64$") + set(_VCPKG_TARGET_TRIPLET_ARCH x64) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[Aa][Rr][Mm]$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^[Aa][Rr][Mm]64$") + set(_VCPKG_TARGET_TRIPLET_ARCH arm64) + else() + + endif() else() find_program(_VCPKG_CL cl) if(_VCPKG_CL MATCHES "amd64/cl.exe$" OR _VCPKG_CL MATCHES "x64/cl.exe$") @@ -95,7 +107,7 @@ if(NOT EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" AND NOT _CMAKE_I message(WARNING "There are no libraries installed for the Vcpkg triplet ${VCPKG_TARGET_TRIPLET}.") endif() -if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) #Debug build: Put Debug paths before Release paths. +if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) #Debug build: Put Debug paths before Release paths. list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} )