Skip to content

Commit

Permalink
build: fix wrong syntax in vcpkg cmake
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rkitover committed Dec 4, 2023
1 parent 717ac7e commit 78b99d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/Set-Toolchain-vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down

0 comments on commit 78b99d8

Please sign in to comment.