Fix dll copying

This commit is contained in:
tamasmeszaros 2020-02-06 11:59:02 +01:00
parent 00737948e6
commit 2e039d3955

View File

@ -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 "$<TARGET_PROPERTY:${target},BINARY_DIR>/$<CONFIG>")
else ()
set (_out_dir "$<TARGET_PROPERTY:${target},BINARY_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)