diff options
| author | Sander Cox <sander@paralleldimension.nl> | 2021-06-11 01:14:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-10 16:14:37 -0700 |
| commit | 03992f2e1dfe78568ec95a381b7f65c90d7cd42d (patch) | |
| tree | 5bc710f61225c17ebd42d94600ef3305d58227bb /scripts | |
| parent | 96bc28ea592fd401ee4c7c3d4845fb9a75a4ed43 (diff) | |
| download | vcpkg-03992f2e1dfe78568ec95a381b7f65c90d7cd42d.tar.gz vcpkg-03992f2e1dfe78568ec95a381b7f65c90d7cd42d.zip | |
Support COMPONENT in X_VCPKG_APPLOCAL_DEPS_INSTALL (#18227)
discussion #17839
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 4eba4b43e..d34580ec0 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -625,15 +625,19 @@ endfunction() # Arguments: # TARGETS - a list of installed targets to have dependencies copied for # DESTINATION - the runtime directory for those targets (usually `bin`) +# COMPONENT - the component this install command belongs to (optional) # # Note that this function requires CMake 3.14 for policy CMP0087 function(x_vcpkg_install_local_dependencies) if(Z_VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") - cmake_parse_arguments(PARSE_ARGV 0 __VCPKG_APPINSTALL "" "DESTINATION" "TARGETS") + cmake_parse_arguments(PARSE_ARGV 0 __VCPKG_APPINSTALL "" "DESTINATION;COMPONENT" "TARGETS") z_vcpkg_set_powershell_path() if(NOT IS_ABSOLUTE "${__VCPKG_APPINSTALL_DESTINATION}") set(__VCPKG_APPINSTALL_DESTINATION "\${CMAKE_INSTALL_PREFIX}/${__VCPKG_APPINSTALL_DESTINATION}") endif() + if(__VCPKG_APPINSTALL_COMPONENT) + set(__VCPKG_APPINSTALL_COMPONENT COMPONENT ${__VCPKG_APPINSTALL_COMPONENT}) + endif() foreach(TARGET IN LISTS __VCPKG_APPINSTALL_TARGETS) get_target_property(TARGETTYPE "${TARGET}" TYPE) if(NOT TARGETTYPE STREQUAL "INTERFACE_LIBRARY") @@ -645,7 +649,9 @@ function(x_vcpkg_install_local_dependencies) execute_process(COMMAND \"${Z_VCPKG_POWERSHELL_PATH}\" -noprofile -executionpolicy Bypass -file \"${Z_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1\" -targetBinary \"${__VCPKG_APPINSTALL_DESTINATION}/$<TARGET_FILE_NAME:${TARGET}>\" -installedDir \"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/bin\" - -OutVariable out)") + -OutVariable out)" + ${__VCPKG_APPINSTALL_COMPONENT} + ) endif() endforeach() endif() @@ -683,9 +689,16 @@ if(X_VCPKG_APPLOCAL_DEPS_INSTALL) if(LAST_COMMAND STREQUAL "DESTINATION" AND (MODIFIER STREQUAL "" OR MODIFIER STREQUAL "RUNTIME")) set(DESTINATION "${ARG}") endif() + if(LAST_COMMAND STREQUAL "COMPONENT") + set(COMPONENT "${ARG}") + endif() endforeach() - x_vcpkg_install_local_dependencies(TARGETS "${PARSED_TARGETS}" DESTINATION "${DESTINATION}") + # COMPONENT is optional only set it when it's been set by the install rule + if(COMPONENT) + set(COMPONENT "COMPONENT" ${COMPONENT}) + endif() + x_vcpkg_install_local_dependencies(TARGETS "${PARSED_TARGETS}" DESTINATION "${DESTINATION}" ${COMPONENT}) endif() endfunction() endif() |
