From 2e039d3955a5f8d47abdd46e9a0c505b1f477dd6 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Thu, 6 Feb 2020 11:59:02 +0100 Subject: [PATCH] Fix dll copying --- CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc0c80869..878f2373e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -440,16 +440,25 @@ function(prusaslicer_copy_dlls target) set(_bits 32) endif () - get_target_property(_out_dir ${target} BINARY_DIR) + get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + get_target_property(_alt_out_dir ${target} RUNTIME_OUTPUT_DIRECTORY) + + if (_alt_out_dir) + set (_out_dir "${_alt_out_dir}") + elseif (_is_multi) + set (_out_dir "$/$") + else () + set (_out_dir "$") + endif () # This has to be a separate target due to the windows command line lenght limits add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir}/ + COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll ${_out_dir} COMMENT "Copy gmp runtime to build tree" VERBATIM) add_custom_command(TARGET ${target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir}/ + COMMAND ${CMAKE_COMMAND} -E copy ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll ${_out_dir} COMMENT "Copy mpfr runtime to build tree" VERBATIM)