diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 922d153e4..1ddb7fa8b 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -117,8 +117,6 @@ add_library(libslic3r STATIC "${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h" Line.cpp Line.hpp - MeshBoolean.cpp - MeshBoolean.hpp Model.cpp Model.hpp Arrange.hpp @@ -220,6 +218,24 @@ add_library(libslic3r STATIC SLA/Clustering.hpp ) +if (SLIC3R_STATIC) + set(CGAL_Boost_USE_STATIC_LIBS ON) + set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE TRUE) +endif () + +find_package(CGAL REQUIRED) + +add_library(libslic3r_cgal OBJECT MeshBoolean.cpp MeshBoolean.hpp) +target_include_directories(libslic3r_cgal PRIVATE + ${CMAKE_CURRENT_BINARY_DIR} + $ + $) +target_compile_definitions(libslic3r_cgal PRIVATE + $) +target_compile_options(libslic3r_cgal PRIVATE + $) +target_sources(libslic3r PRIVATE $) + encoding_check(libslic3r) target_compile_definitions(libslic3r PUBLIC -DUSE_TBB -DTBB_USE_CAPTURED_EXCEPTION=0) @@ -240,6 +256,7 @@ target_link_libraries(libslic3r qhull semver TBB::tbb + $ ${CMAKE_DL_LIBS} ) diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 5ce464eb1..4156481b0 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -177,7 +177,7 @@ add_library(libslic3r_gui STATIC ${SLIC3R_GUI_SOURCES}) encoding_check(libslic3r_gui) -target_link_libraries(libslic3r_gui libslic3r avrdude cereal imgui GLEW::GLEW OpenGL::GL OpenGL::GLU hidapi CGAL::CGAL) +target_link_libraries(libslic3r_gui libslic3r avrdude cereal imgui GLEW::GLEW OpenGL::GL OpenGL::GLU hidapi) if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY) add_precompiled_header(libslic3r_gui pchheader.hpp FORCEINCLUDE) endif ()