From 78b99d8b2362ce24337f0d4d78f176092afa0e4d Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Mon, 4 Dec 2023 00:13:29 +0000 Subject: [PATCH] build: fix wrong syntax in vcpkg cmake Fix if(EXISTS var) statements to be written as if(EXISTS ${var}) because the EXISTS operator does not accept variable references. Signed-off-by: Rafael Kitover --- cmake/Set-Toolchain-vcpkg.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Set-Toolchain-vcpkg.cmake b/cmake/Set-Toolchain-vcpkg.cmake index 18e05198..f0bab6b7 100644 --- a/cmake/Set-Toolchain-vcpkg.cmake +++ b/cmake/Set-Toolchain-vcpkg.cmake @@ -350,7 +350,7 @@ function(vcpkg_set_toolchain) elseif(EXISTS c:/vcpkg) set(VCPKG_ROOT c:/vcpkg) # Prefer the preferred root to the VS default which is more difficult to deal with, if it exists. - elseif(EXISTS preferred_root) + elseif(EXISTS ${preferred_root}) set(VCPKG_ROOT ${preferred_root}) else() find_program(vcpkg_exe_path NAME vcpkg.exe HINTS ENV PATH) @@ -375,7 +375,7 @@ function(vcpkg_set_toolchain) set(VCPKG_ROOT ${VCPKG_ROOT} CACHE FILEPATH "vcpkg installation root path" FORCE) - if(NOT EXISTS VCPKG_ROOT) + if(NOT EXISTS ${VCPKG_ROOT}) get_filename_component(root_parent ${VCPKG_ROOT}/.. ABSOLUTE) execute_process(