From ef07f10f97f18e5c987ae9b0249a0d18f0e8c49a Mon Sep 17 00:00:00 2001 From: msclock Date: Fri, 1 Mar 2024 17:25:15 +0800 Subject: [PATCH] build: optimize cmake tool file load --- CMakeLists.txt | 4 +++- template/CMakeLists.txt.jinja | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1046492..0e5d2286 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,9 @@ else() endif() # set cmake tool chain -set(CMAKE_TOOLCHAIN_FILE ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) +file(TO_CMAKE_PATH ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake + vcpkg_toolchain_file) +set(CMAKE_TOOLCHAIN_FILE ${vcpkg_toolchain_file}) set(VCPKG_VERBOSE ON diff --git a/template/CMakeLists.txt.jinja b/template/CMakeLists.txt.jinja index 11b8fec8..34738b69 100644 --- a/template/CMakeLists.txt.jinja +++ b/template/CMakeLists.txt.jinja @@ -13,7 +13,9 @@ else() endif() # set cmake tool chain -set(CMAKE_TOOLCHAIN_FILE ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) +file(TO_CMAKE_PATH ${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake + vcpkg_toolchain_file) +set(CMAKE_TOOLCHAIN_FILE ${vcpkg_toolchain_file}) set(VCPKG_VERBOSE ON