Add MeshBoolean.cpp with CGAL as object library.

This commit is contained in:
tamasmeszaros 2019-12-16 11:08:36 +01:00
parent a9403319b7
commit 464ec8da6a
2 changed files with 20 additions and 3 deletions

View File

@ -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_PROPERTY:libigl,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:CGAL::CGAL,INTERFACE_INCLUDE_DIRECTORIES>)
target_compile_definitions(libslic3r_cgal PRIVATE
$<TARGET_PROPERTY:CGAL::CGAL,INTERFACE_COMPILE_DEFINITIONS>)
target_compile_options(libslic3r_cgal PRIVATE
$<TARGET_PROPERTY:CGAL::CGAL,INTERFACE_COMPILE_OPTIONS>)
target_sources(libslic3r PRIVATE $<TARGET_OBJECTS:libslic3r_cgal>)
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
$<TARGET_PROPERTY:CGAL::CGAL,INTERFACE_LINK_LIBRARIES>
${CMAKE_DL_LIBS}
)

View File

@ -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 ()