Skip to content

Commit

Permalink
[vcpkg.cmake] add VCPKG_INSTALLED_DIR as a settable option (#16303)
Browse files Browse the repository at this point in the history
this change does not actually make any changes,
except that `VCPKG_INSTALLED_DIR` and sets `_VCPKG_INSTALLED_DIR`.
In the future, we can start using `VCPKG_INSTALLED_DIR`
completely.
  • Loading branch information
strega-nil authored Jun 10, 2021
1 parent 680b27d commit f51c703
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions scripts/buildsystems/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,22 @@ if(NOT Z_VCPKG_ROOT_DIR)
z_vcpkg_add_fatal_error("Could not find .vcpkg-root")
endif()

if(NOT DEFINED _VCPKG_INSTALLED_DIR)
if(VCPKG_MANIFEST_MODE)
set(_VCPKG_INSTALLED_DIR "${CMAKE_BINARY_DIR}/vcpkg_installed")
else()
set(_VCPKG_INSTALLED_DIR "${Z_VCPKG_ROOT_DIR}/installed")
endif()
set(_VCPKG_INSTALLED_DIR "${_VCPKG_INSTALLED_DIR}"
if(DEFINED VCPKG_INSTALLED_DIR)
# do nothing
elseif(DEFINED _VCPKG_INSTALLED_DIR)
set(VCPKG_INSTALLED_DIR "${_VCPKG_INSTALLED_DIR}")
elseif(VCPKG_MANIFEST_MODE)
set(VCPKG_INSTALLED_DIR "${CMAKE_BINARY_DIR}/vcpkg_installed")
else()
set(VCPKG_INSTALLED_DIR "${Z_VCPKG_ROOT_DIR}/installed")
endif()

set(VCPKG_INSTALLED_DIR "${VCPKG_INSTALLED_DIR}"
CACHE PATH
"The directory which contains the installed libraries for each triplet" FORCE)
set(_VCPKG_INSTALLED_DIR "${VCPKG_INSTALLED_DIR}"
CACHE PATH
"The directory which contains the installed libraries for each triplet" FORCE)
endif()

if(CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$" OR NOT DEFINED CMAKE_BUILD_TYPE) #Debug build: Put Debug paths before Release paths.
list(APPEND CMAKE_PREFIX_PATH
Expand Down

0 comments on commit f51c703

Please sign in to comment.