From 198e2467dd91d26217559b95a8331b01a0d06be6 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Tue, 3 Dec 2019 18:59:42 +0000 Subject: [PATCH] cmake: Add vcpkg update and upgrade. In the vcpkg module, call vcpkg update to update the portfiles and vcpkg upgrade to upgrade any installed ports to make sure we are using the latest versions. Signed-off-by: Rafael Kitover --- cmake/Set-Toolchain-vcpkg.cmake | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/cmake/Set-Toolchain-vcpkg.cmake b/cmake/Set-Toolchain-vcpkg.cmake index fd82240e..21f214e2 100644 --- a/cmake/Set-Toolchain-vcpkg.cmake +++ b/cmake/Set-Toolchain-vcpkg.cmake @@ -71,19 +71,30 @@ if(VCPKG_TARGET_TRIPLET) list(APPEND VCPKG_DEPS_QUALIFIED ${pkg}:${VCPKG_TARGET_TRIPLET}) endforeach() - # build our deps if(WIN32) - execute_process( - COMMAND vcpkg install ${VCPKG_DEPS_QUALIFIED} - WORKING_DIRECTORY ${VCPKG_ROOT} - ) + set(vcpkg_exe vcpkg) else() - execute_process( - COMMAND ./vcpkg install ${VCPKG_DEPS_QUALIFIED} - WORKING_DIRECTORY ${VCPKG_ROOT} - ) + set(vcpkg_exe ./vcpkg) endif() + # update portfiles + execute_process( + COMMAND ${vcpkg_exe} update + WORKING_DIRECTORY ${VCPKG_ROOT} + ) + + # build our deps + execute_process( + COMMAND ${vcpkg_exe} install ${VCPKG_DEPS_QUALIFIED} + WORKING_DIRECTORY ${VCPKG_ROOT} + ) + + # make sure we have the latest versions + execute_process( + COMMAND ${vcpkg_exe} upgrade --no-dry-run + WORKING_DIRECTORY ${VCPKG_ROOT} + ) + if(WIN32 AND VCPKG_TARGET_TRIPLET MATCHES x64) set(CMAKE_GENERATOR_PLATFORM x64 CACHE STRING "visual studio build architecture" FORCE) endif()