diff options
| author | Sander Cox <sander@resolume.com> | 2020-10-13 23:40:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-13 14:40:16 -0700 |
| commit | 0a41fb2dfa6b0714da83e00aa3802302c7ec7fb4 (patch) | |
| tree | 8e487a86c8a6ded607829ae99f0ac9f2bef3b394 /scripts | |
| parent | eaa2e3db0fa6162112fa76e87ac44a67db7225c8 (diff) | |
| download | vcpkg-0a41fb2dfa6b0714da83e00aa3802302c7ec7fb4.tar.gz vcpkg-0a41fb2dfa6b0714da83e00aa3802302c7ec7fb4.zip | |
[vcpkg] VCPKG_APPINSTALL_DEPS install dependencies on install #1653 (#13011)
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 1092bc944..00e6645fa 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -443,6 +443,26 @@ function(add_library name) endif() endfunction() +# This is an experimental function to enable applocal install of dependencies as part of the `make install` process +# Arguments: +# TARGETS - a list of installed targets to have dependencies copied for +# DESTINATION - the runtime directory for those targets (usually `bin`) +function(x_vcpkg_install_local_dependencies) + if(_VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") + # Parse command line + cmake_parse_arguments(__VCPKG_APPINSTALL "" "DESTINATION" "TARGETS" ${ARGN}) + + foreach(TARGET ${__VCPKG_APPINSTALL_TARGETS}) + _install(CODE "message(\"-- Installing app dependencies for ${TARGET}...\") + execute_process(COMMAND + powershell -noprofile -executionpolicy Bypass -file \"${_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)") + endforeach() + endif() +endfunction() + if(NOT DEFINED VCPKG_OVERRIDE_FIND_PACKAGE_NAME) set(VCPKG_OVERRIDE_FIND_PACKAGE_NAME find_package) endif() |
