[vcpkg.cmake] check for vcpkg.json only in ${CMAKE_SOURCE_DIR} (#12523)

This commit is contained in:
nicole mazzuca 2020-08-22 02:04:16 -07:00 committed by GitHub
parent de0501f187
commit b919cf7f7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,13 @@ function(_vcpkg_get_directory_name_of_file_above OUT DIRECTORY FILENAME)
set(${OUT} ${_vcpkg_get_dir_out} CACHE INTERNAL "_vcpkg_get_directory_name_of_file_above: ${OUT}")
endfunction()
_vcpkg_get_directory_name_of_file_above(_VCPKG_MANIFEST_DIR ${CMAKE_CURRENT_SOURCE_DIR} "vcpkg.json")
if(NOT DEFINED VCPKG_MANIFEST_DIR)
if(EXISTS "${CMAKE_SOURCE_DIR}/vcpkg.json")
set(_VCPKG_MANIFEST_DIR "${CMAKE_SOURCE_DIR}/vcpkg.json")
endif()
else()
set(_VCPKG_MANIFEST_DIR ${VCPKG_MANIFEST_DIR})
endif()
if(NOT DEFINED VCPKG_MANIFEST_MODE)
if(_VCPKG_MANIFEST_DIR)
set(VCPKG_MANIFEST_MODE ON)