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 <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2023-12-04 00:13:29 +00:00
parent 717ac7ed74
commit 78b99d8b23
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 2 additions and 2 deletions

View File

@ -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(