Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2019-12-10 19:42:25 +0300
committertamasmeszaros <meszaros.q@gmail.com>2019-12-10 19:42:25 +0300
commitfc19666fa295252cb13d9521e7978f4aeeb1f885 (patch)
treee0287fe8baaa333aea21d63ab99ce757825b0e33
parent1cf057abbc5fb7a15bdccd0a13531af7a6cb9dbc (diff)
Add dll copy after targets for gmp and mpfr
-rw-r--r--CMakeLists.txt23
-rw-r--r--sandboxes/meshboolean/CMakeLists.txt4
-rw-r--r--src/CMakeLists.txt5
3 files changed, 32 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a41229987..a3b909b57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -403,6 +403,29 @@ if(SLIC3R_STATIC)
set(USE_BLOSC TRUE)
endif()
+set(TOP_LEVEL_PROJECT_DIR ${PROJECT_SOURCE_DIR})
+function(prusaslicer_copy_dlls target)
+ if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
+ set(_bits 64)
+ elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
+ set(_bits 32)
+ endif ()
+
+ get_target_property(_out_dir ${target} BINARY_DIR)
+
+ # 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}/
+ 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}/
+ COMMENT "Copy mpfr runtime to build tree"
+ VERBATIM)
+
+endfunction()
+
#find_package(OpenVDB 5.0 COMPONENTS openvdb)
#slic3r_remap_configs(IlmBase::Half RelWithDebInfo Release)
diff --git a/sandboxes/meshboolean/CMakeLists.txt b/sandboxes/meshboolean/CMakeLists.txt
index 69ea13dce..17e876573 100644
--- a/sandboxes/meshboolean/CMakeLists.txt
+++ b/sandboxes/meshboolean/CMakeLists.txt
@@ -7,3 +7,7 @@ find_package(CGAL REQUIRED)
add_executable(meshboolean MeshBoolean.cpp)
target_link_libraries(meshboolean libslic3r CGAL::CGAL)
+
+if (WIN32)
+ prusaslicer_copy_dlls(meshboolean)
+endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 530512cbb..52ec0f144 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -195,6 +195,11 @@ if (WIN32)
VERBATIM
)
endif ()
+
+ # This has to be a separate target due to the windows command line lenght limits
+ add_custom_target(PrusaSlicerDllsCopy ALL DEPENDS PrusaSlicer)
+ prusaslicer_copy_dlls(PrusaSlicerDllsCopy)
+
elseif (XCODE)
# Because of Debug/Release/etc. configurations (similar to MSVC) the slic3r binary is located in an extra level
add_custom_command(TARGET PrusaSlicer POST_BUILD