AutoVcpkg: Copy bootstrap file from cmake folder

AutoVcpkg assumed that the bootstrap file was in the root project
folder, and not in a cmake subfolder.

Note: It is not correct to use ${CMAKE_CURRENT_LIST_DIR} since this is
inside a function and whould still refer to the folder of the calling
file. The more elegant solution would be to use
${CMAKE_CURRENT_FUNCTION_LIST_DIR}, but that is not available until
CMake 3.17.
This commit is contained in:
Eirik Marthinsen 2021-08-29 21:14:13 +01:00 committed by Magne Sjaastad
parent 8d42533179
commit 697da887c4

View File

@ -77,7 +77,7 @@ function (vcpkg_bootstrap)
find_program(AUTO_VCPKG_EXECUTABLE
vcpkg PATHS ${AUTO_VCPKG_ROOT})
if (NOT AUTO_VCPKG_EXECUTABLE)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/vcpkg-bootstrap.cmake" "${AUTO_VCPKG_ROOT}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/cmake/vcpkg-bootstrap.cmake" "${AUTO_VCPKG_ROOT}")
execute_process(COMMAND ${CMAKE_COMMAND} -P "${AUTO_VCPKG_ROOT}/vcpkg-bootstrap.cmake"
WORKING_DIRECTORY ${AUTO_VCPKG_ROOT})
endif ()