[vcpkg] fix X_VCPKG_APPLOCAL_DEPS_INSTALL (#15960)

* [vcpkg] fix X_VCPKG_APPLOCAL_DEPS_INSTALL

* [vcpkg] fix x_vcpkg_install_local_dependencies

Fixed `x_vcpkg_install_local_dependencies` always assuming a relative `DESTINATION`.
This commit is contained in:
David Hrdlička 2021-02-03 21:51:28 +01:00 committed by GitHub
parent e76c524f63
commit 9adaafc4f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -526,6 +526,9 @@ function(x_vcpkg_install_local_dependencies)
if(_VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp")
cmake_parse_arguments(PARSE_ARGV 0 __VCPKG_APPINSTALL "" "DESTINATION" "TARGETS")
_vcpkg_set_powershell_path()
if(NOT IS_ABSOLUTE ${__VCPKG_APPINSTALL_DESTINATION})
set(__VCPKG_APPINSTALL_DESTINATION "\${CMAKE_INSTALL_PREFIX}/${__VCPKG_APPINSTALL_DESTINATION}")
endif()
foreach(TARGET IN LISTS __VCPKG_APPINSTALL_TARGETS)
get_target_property(TARGETTYPE ${TARGET} TYPE)
if(NOT TARGETTYPE STREQUAL "INTERFACE_LIBRARY")
@ -535,7 +538,7 @@ function(x_vcpkg_install_local_dependencies)
endif()
install(CODE "message(\"-- Installing app dependencies for ${TARGET}...\")
execute_process(COMMAND \"${_VCPKG_POWERSHELL_PATH}\" -noprofile -executionpolicy Bypass -file \"${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1\"
-targetBinary \"\${CMAKE_INSTALL_PREFIX}/${__VCPKG_APPINSTALL_DESTINATION}/$<TARGET_FILE_NAME:${TARGET}>\"
-targetBinary \"${__VCPKG_APPINSTALL_DESTINATION}/$<TARGET_FILE_NAME:${TARGET}>\"
-installedDir \"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/bin\"
-OutVariable out)")
endif()
@ -553,7 +556,7 @@ if(X_VCPKG_APPLOCAL_DEPS_INSTALL)
set(PARSED_TARGETS "")
# Destination - [RUNTIME] DESTINATION argument overrides this
set(DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
set(DESTINATION "bin")
# Parse arguments given to the install function to find targets and (runtime) destination
set(MODIFIER "") # Modifier for the command in the argument