From 200d5c65a39ba92d196ffb3ada42bebb0928c534 Mon Sep 17 00:00:00 2001 From: Eirik Marthinsen Date: Sun, 29 Aug 2021 21:24:48 +0100 Subject: [PATCH] AutoVcpkg: Include Vcpkg toolchain Include the Vcpkg toolchain file after the installation of the first package. When building for the first time from a clean source tree, the Vcpkg toolchain file does not exist. At the same time CMake is only reading the toolchain file the very first time it is configuring, but since the toolchain file is only created when vcpkg is configured on the first call to vcpkg_install it will never read it. So it is not enough to just reconfigure. Note: It is not ideal to include it here since one might at some point install and search for a package at an erlier point in the script and fail to find it. Alternative approaces that I considered: - Include this file right after including AutoVcpkg. This would require 1 recompilation for the file to be found and read which is unfortunate. - Include this file in the config function in AutoVcpkg. This seemed difficult without including the file for every call to vcpkg_install, which seems unecessary. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dc65dfe10..3a52df9bdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,6 +340,7 @@ endif() # MSVC if(VCPKG_AUTO_INSTALL) vcpkg_install(boost-filesystem) vcpkg_install(boost-spirit) + include(${CMAKE_TOOLCHAIN_FILE}) endif() add_subdirectory(ThirdParty/custom-opm-flowdiagnostics)