From 78b1396b88f93f74f9a007599e5998026445f14f Mon Sep 17 00:00:00 2001 From: Bruce Jones Date: Tue, 13 Feb 2018 19:13:27 -0500 Subject: Copy local dependencies for library targets (#2787) * Fix for issue #2786 * [vcpkg-cmake-toolchain] Only applocal dependencies for shared libraries --- scripts/buildsystems/vcpkg.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 0cb311555..ceb43940b 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -163,6 +163,15 @@ function(add_library name) list(FIND ARGV "INTERFACE" INTERFACE_IDX) list(FIND ARGV "ALIAS" ALIAS_IDX) if(IMPORTED_IDX EQUAL -1 AND INTERFACE_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) + get_target_property(IS_LIBRARY_SHARED ${name} TYPE) + if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp" AND IS_LIBRARY_SHARED STREQUAL "SHARED_LIBRARY") + add_custom_command(TARGET ${name} POST_BUILD + COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 + -targetBinary $ + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$:/debug>/bin" + -OutVariable out + ) + endif() set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) endif() -- cgit v1.2.3