2018-09-19 09:02:24 +00:00
|
|
|
project(libslic3r)
|
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
|
2018-10-29 15:01:26 +00:00
|
|
|
include(PrecompiledHeader)
|
|
|
|
|
2018-09-24 09:53:05 +00:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libslic3r_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h @ONLY)
|
|
|
|
|
2019-08-16 14:17:37 +00:00
|
|
|
if (MINGW)
|
|
|
|
add_compile_options(-Wa,-mbig-obj)
|
|
|
|
endif ()
|
|
|
|
|
2019-11-01 14:31:26 +00:00
|
|
|
set(OpenVDBUtils_SOURCES "")
|
|
|
|
if (TARGET OpenVDB::openvdb)
|
|
|
|
set(OpenVDBUtils_SOURCES OpenVDBUtils.cpp OpenVDBUtils.hpp)
|
|
|
|
endif()
|
|
|
|
|
2018-09-19 09:02:24 +00:00
|
|
|
add_library(libslic3r STATIC
|
2018-10-29 15:01:26 +00:00
|
|
|
pchheader.cpp
|
|
|
|
pchheader.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
BoundingBox.cpp
|
|
|
|
BoundingBox.hpp
|
|
|
|
BridgeDetector.cpp
|
|
|
|
BridgeDetector.hpp
|
|
|
|
ClipperUtils.cpp
|
|
|
|
ClipperUtils.hpp
|
|
|
|
Config.cpp
|
|
|
|
Config.hpp
|
|
|
|
EdgeGrid.cpp
|
|
|
|
EdgeGrid.hpp
|
2019-11-01 18:59:09 +00:00
|
|
|
ElephantFootCompensation.cpp
|
|
|
|
ElephantFootCompensation.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
ExPolygon.cpp
|
|
|
|
ExPolygon.hpp
|
|
|
|
ExPolygonCollection.cpp
|
|
|
|
ExPolygonCollection.hpp
|
|
|
|
Extruder.cpp
|
|
|
|
Extruder.hpp
|
|
|
|
ExtrusionEntity.cpp
|
|
|
|
ExtrusionEntity.hpp
|
|
|
|
ExtrusionEntityCollection.cpp
|
|
|
|
ExtrusionEntityCollection.hpp
|
|
|
|
ExtrusionSimulator.cpp
|
|
|
|
ExtrusionSimulator.hpp
|
|
|
|
FileParserError.hpp
|
|
|
|
Fill/Fill.cpp
|
|
|
|
Fill/Fill.hpp
|
|
|
|
Fill/Fill3DHoneycomb.cpp
|
|
|
|
Fill/Fill3DHoneycomb.hpp
|
|
|
|
Fill/FillBase.cpp
|
|
|
|
Fill/FillBase.hpp
|
|
|
|
Fill/FillConcentric.cpp
|
|
|
|
Fill/FillConcentric.hpp
|
|
|
|
Fill/FillHoneycomb.cpp
|
|
|
|
Fill/FillHoneycomb.hpp
|
|
|
|
Fill/FillGyroid.cpp
|
|
|
|
Fill/FillGyroid.hpp
|
|
|
|
Fill/FillPlanePath.cpp
|
|
|
|
Fill/FillPlanePath.hpp
|
|
|
|
Fill/FillRectilinear.cpp
|
|
|
|
Fill/FillRectilinear.hpp
|
|
|
|
Fill/FillRectilinear2.cpp
|
|
|
|
Fill/FillRectilinear2.hpp
|
|
|
|
Fill/FillRectilinear3.cpp
|
|
|
|
Fill/FillRectilinear3.hpp
|
|
|
|
Flow.cpp
|
|
|
|
Flow.hpp
|
2020-04-01 07:48:56 +00:00
|
|
|
format.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
Format/3mf.cpp
|
|
|
|
Format/3mf.hpp
|
|
|
|
Format/AMF.cpp
|
|
|
|
Format/AMF.hpp
|
|
|
|
Format/OBJ.cpp
|
|
|
|
Format/OBJ.hpp
|
|
|
|
Format/objparser.cpp
|
|
|
|
Format/objparser.hpp
|
|
|
|
Format/PRUS.cpp
|
|
|
|
Format/PRUS.hpp
|
|
|
|
Format/STL.cpp
|
|
|
|
Format/STL.hpp
|
2020-04-13 10:31:37 +00:00
|
|
|
Format/SL1.hpp
|
|
|
|
Format/SL1.cpp
|
2018-09-19 09:02:24 +00:00
|
|
|
GCode/Analyzer.cpp
|
|
|
|
GCode/Analyzer.hpp
|
2019-10-22 14:02:31 +00:00
|
|
|
GCode/ThumbnailData.cpp
|
|
|
|
GCode/ThumbnailData.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
GCode/CoolingBuffer.cpp
|
|
|
|
GCode/CoolingBuffer.hpp
|
|
|
|
GCode/PostProcessor.cpp
|
2019-08-16 14:17:37 +00:00
|
|
|
GCode/PostProcessor.hpp
|
2019-01-29 17:07:45 +00:00
|
|
|
# GCode/PressureEqualizer.cpp
|
|
|
|
# GCode/PressureEqualizer.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
GCode/PreviewData.cpp
|
|
|
|
GCode/PreviewData.hpp
|
|
|
|
GCode/PrintExtents.cpp
|
|
|
|
GCode/PrintExtents.hpp
|
|
|
|
GCode/SpiralVase.cpp
|
|
|
|
GCode/SpiralVase.hpp
|
|
|
|
GCode/ToolOrdering.cpp
|
|
|
|
GCode/ToolOrdering.hpp
|
2019-06-17 08:26:33 +00:00
|
|
|
GCode/WipeTower.cpp
|
2018-09-19 09:02:24 +00:00
|
|
|
GCode/WipeTower.hpp
|
|
|
|
GCode.cpp
|
|
|
|
GCode.hpp
|
|
|
|
GCodeReader.cpp
|
|
|
|
GCodeReader.hpp
|
2019-01-16 11:22:17 +00:00
|
|
|
# GCodeSender.cpp
|
|
|
|
# GCodeSender.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
GCodeTimeEstimator.cpp
|
|
|
|
GCodeTimeEstimator.hpp
|
|
|
|
GCodeWriter.cpp
|
|
|
|
GCodeWriter.hpp
|
|
|
|
Geometry.cpp
|
|
|
|
Geometry.hpp
|
|
|
|
Int128.hpp
|
2019-09-27 09:42:52 +00:00
|
|
|
KDTreeIndirect.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
Layer.cpp
|
|
|
|
Layer.hpp
|
|
|
|
LayerRegion.cpp
|
|
|
|
libslic3r.h
|
2018-09-24 09:53:05 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/libslic3r_version.h"
|
2018-09-19 09:02:24 +00:00
|
|
|
Line.cpp
|
|
|
|
Line.hpp
|
|
|
|
Model.cpp
|
|
|
|
Model.hpp
|
2020-04-23 16:19:03 +00:00
|
|
|
ModelArrange.hpp
|
|
|
|
ModelArrange.cpp
|
2020-01-23 11:49:39 +00:00
|
|
|
CustomGCode.cpp
|
|
|
|
CustomGCode.hpp
|
2019-07-01 16:22:07 +00:00
|
|
|
Arrange.hpp
|
|
|
|
Arrange.cpp
|
2018-09-19 09:02:24 +00:00
|
|
|
MotionPlanner.cpp
|
|
|
|
MotionPlanner.hpp
|
|
|
|
MultiPoint.cpp
|
|
|
|
MultiPoint.hpp
|
|
|
|
MutablePriorityQueue.hpp
|
2019-06-27 09:02:45 +00:00
|
|
|
ObjectID.cpp
|
|
|
|
ObjectID.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
PerimeterGenerator.cpp
|
|
|
|
PerimeterGenerator.hpp
|
|
|
|
PlaceholderParser.cpp
|
|
|
|
PlaceholderParser.hpp
|
|
|
|
Point.cpp
|
|
|
|
Point.hpp
|
|
|
|
Polygon.cpp
|
|
|
|
Polygon.hpp
|
2019-08-21 12:52:22 +00:00
|
|
|
PolygonTrimmer.cpp
|
|
|
|
PolygonTrimmer.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
Polyline.cpp
|
|
|
|
Polyline.hpp
|
|
|
|
Print.cpp
|
|
|
|
Print.hpp
|
2018-11-08 13:23:17 +00:00
|
|
|
PrintBase.cpp
|
|
|
|
PrintBase.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
PrintConfig.cpp
|
|
|
|
PrintConfig.hpp
|
|
|
|
PrintObject.cpp
|
|
|
|
PrintRegion.cpp
|
2019-08-09 15:01:37 +00:00
|
|
|
Semver.cpp
|
2019-09-26 07:44:38 +00:00
|
|
|
ShortestPath.cpp
|
|
|
|
ShortestPath.hpp
|
2018-11-08 19:18:40 +00:00
|
|
|
SLAPrint.cpp
|
2019-11-12 15:53:47 +00:00
|
|
|
SLAPrintSteps.cpp
|
|
|
|
SLAPrintSteps.hpp
|
2018-11-08 19:18:40 +00:00
|
|
|
SLAPrint.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
Slicing.cpp
|
|
|
|
Slicing.hpp
|
2020-04-13 10:31:37 +00:00
|
|
|
SlicesToTriangleMesh.hpp
|
|
|
|
SlicesToTriangleMesh.cpp
|
2018-09-19 09:02:24 +00:00
|
|
|
SlicingAdaptive.cpp
|
|
|
|
SlicingAdaptive.hpp
|
|
|
|
SupportMaterial.cpp
|
|
|
|
SupportMaterial.hpp
|
|
|
|
Surface.cpp
|
|
|
|
Surface.hpp
|
|
|
|
SurfaceCollection.cpp
|
|
|
|
SurfaceCollection.hpp
|
|
|
|
SVG.cpp
|
|
|
|
SVG.hpp
|
|
|
|
Technologies.hpp
|
2019-02-05 18:45:52 +00:00
|
|
|
Tesselate.cpp
|
|
|
|
Tesselate.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
TriangleMesh.cpp
|
|
|
|
TriangleMesh.hpp
|
2020-04-13 10:31:37 +00:00
|
|
|
TriangulateWall.hpp
|
|
|
|
TriangulateWall.cpp
|
2018-09-19 09:02:24 +00:00
|
|
|
utils.cpp
|
|
|
|
Utils.hpp
|
2019-09-11 10:13:59 +00:00
|
|
|
Time.cpp
|
|
|
|
Time.hpp
|
2018-11-21 14:21:57 +00:00
|
|
|
MTUtils.hpp
|
2020-06-04 11:49:49 +00:00
|
|
|
VoronoiOffset.cpp
|
|
|
|
VoronoiOffset.hpp
|
2020-06-11 14:09:51 +00:00
|
|
|
VoronoiVisualUtils.hpp
|
2019-03-14 18:07:16 +00:00
|
|
|
Zipper.hpp
|
|
|
|
Zipper.cpp
|
2019-06-06 12:27:07 +00:00
|
|
|
MinAreaBoundingBox.hpp
|
|
|
|
MinAreaBoundingBox.cpp
|
2019-06-03 13:27:46 +00:00
|
|
|
miniz_extension.hpp
|
|
|
|
miniz_extension.cpp
|
2020-01-23 09:57:51 +00:00
|
|
|
SimplifyMesh.hpp
|
|
|
|
SimplifyMeshImpl.hpp
|
|
|
|
SimplifyMesh.cpp
|
2020-04-13 10:31:37 +00:00
|
|
|
MarchingSquares.hpp
|
2019-11-01 14:31:26 +00:00
|
|
|
${OpenVDBUtils_SOURCES}
|
2019-11-11 10:41:14 +00:00
|
|
|
SLA/Common.hpp
|
|
|
|
SLA/Common.cpp
|
|
|
|
SLA/Pad.hpp
|
|
|
|
SLA/Pad.cpp
|
|
|
|
SLA/SupportTreeBuilder.hpp
|
|
|
|
SLA/SupportTreeBuildsteps.hpp
|
|
|
|
SLA/SupportTreeBuildsteps.cpp
|
|
|
|
SLA/SupportTreeBuilder.cpp
|
|
|
|
SLA/Concurrency.hpp
|
|
|
|
SLA/SupportTree.hpp
|
|
|
|
SLA/SupportTree.cpp
|
|
|
|
# SLA/SupportTreeIGL.cpp
|
|
|
|
SLA/Rotfinder.hpp
|
|
|
|
SLA/Rotfinder.cpp
|
|
|
|
SLA/BoostAdapter.hpp
|
|
|
|
SLA/SpatIndex.hpp
|
2020-04-13 10:31:37 +00:00
|
|
|
SLA/RasterBase.hpp
|
|
|
|
SLA/RasterBase.cpp
|
|
|
|
SLA/AGGRaster.hpp
|
|
|
|
SLA/RasterToPolygons.hpp
|
|
|
|
SLA/RasterToPolygons.cpp
|
2019-10-09 12:59:09 +00:00
|
|
|
SLA/ConcaveHull.hpp
|
|
|
|
SLA/ConcaveHull.cpp
|
2019-11-08 08:21:30 +00:00
|
|
|
SLA/Hollowing.hpp
|
|
|
|
SLA/Hollowing.cpp
|
2019-11-11 10:41:14 +00:00
|
|
|
SLA/JobController.hpp
|
|
|
|
SLA/SupportPoint.hpp
|
|
|
|
SLA/SupportPointGenerator.hpp
|
|
|
|
SLA/SupportPointGenerator.cpp
|
|
|
|
SLA/Contour3D.hpp
|
|
|
|
SLA/Contour3D.cpp
|
|
|
|
SLA/EigenMesh3D.hpp
|
|
|
|
SLA/Clustering.hpp
|
2020-05-12 13:52:33 +00:00
|
|
|
SLA/ReprojectPointsOnMesh.hpp
|
2018-09-19 09:02:24 +00:00
|
|
|
)
|
|
|
|
|
2019-12-16 10:08:36 +00:00
|
|
|
if (SLIC3R_STATIC)
|
2019-12-17 09:12:37 +00:00
|
|
|
set(CGAL_Boost_USE_STATIC_LIBS ON CACHE BOOL "" FORCE)
|
2019-12-16 10:08:36 +00:00
|
|
|
endif ()
|
2019-12-17 09:12:37 +00:00
|
|
|
set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE ON CACHE BOOL "" FORCE)
|
2019-12-16 10:08:36 +00:00
|
|
|
|
2019-12-17 09:12:37 +00:00
|
|
|
cmake_policy(PUSH)
|
|
|
|
cmake_policy(SET CMP0011 NEW)
|
2019-12-16 10:08:36 +00:00
|
|
|
find_package(CGAL REQUIRED)
|
2019-12-17 09:12:37 +00:00
|
|
|
cmake_policy(POP)
|
2019-12-16 10:08:36 +00:00
|
|
|
|
2020-01-28 13:49:07 +00:00
|
|
|
add_library(libslic3r_cgal STATIC MeshBoolean.cpp MeshBoolean.hpp)
|
|
|
|
target_include_directories(libslic3r_cgal PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
|
|
# Reset compile options of libslic3r_cgal. Despite it being linked privately, CGAL options
|
|
|
|
# (-frounding-math) still propagate to dependent libs which is not desired.
|
|
|
|
get_target_property(_cgal_tgt CGAL::CGAL ALIASED_TARGET)
|
|
|
|
if (NOT TARGET ${_cgal_tgt})
|
|
|
|
set (_cgal_tgt CGAL::CGAL)
|
|
|
|
endif ()
|
|
|
|
get_target_property(_opts ${_cgal_tgt} INTERFACE_COMPILE_OPTIONS)
|
2020-01-28 14:08:07 +00:00
|
|
|
if (_opts)
|
|
|
|
set(_opts_bad "${_opts}")
|
|
|
|
set(_opts_good "${_opts}")
|
|
|
|
list(FILTER _opts_bad INCLUDE REGEX frounding-math)
|
|
|
|
list(FILTER _opts_good EXCLUDE REGEX frounding-math)
|
|
|
|
set_target_properties(${_cgal_tgt} PROPERTIES INTERFACE_COMPILE_OPTIONS "${_opts_good}")
|
|
|
|
target_compile_options(libslic3r_cgal PRIVATE "${_opts_bad}")
|
|
|
|
endif()
|
2020-01-28 13:49:07 +00:00
|
|
|
|
|
|
|
target_link_libraries(libslic3r_cgal PRIVATE ${_cgal_tgt} libigl)
|
2019-12-16 10:08:36 +00:00
|
|
|
|
2020-01-28 14:24:23 +00:00
|
|
|
if (MSVC AND "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") # 32 bit MSVC workaround
|
|
|
|
target_compile_definitions(libslic3r_cgal PRIVATE CGAL_DO_NOT_USE_MPZF)
|
|
|
|
endif ()
|
|
|
|
|
2019-08-19 10:25:18 +00:00
|
|
|
encoding_check(libslic3r)
|
|
|
|
|
2019-10-14 10:50:08 +00:00
|
|
|
target_compile_definitions(libslic3r PUBLIC -DUSE_TBB -DTBB_USE_CAPTURED_EXCEPTION=0)
|
2020-04-28 07:56:54 +00:00
|
|
|
target_include_directories(libslic3r PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
target_include_directories(libslic3r PUBLIC ${EXPAT_INCLUDE_DIRS})
|
2018-09-19 09:02:24 +00:00
|
|
|
target_link_libraries(libslic3r
|
2018-10-23 15:18:38 +00:00
|
|
|
libnest2d
|
2018-09-19 09:02:24 +00:00
|
|
|
admesh
|
2019-06-26 11:26:49 +00:00
|
|
|
cereal
|
2019-06-19 12:52:55 +00:00
|
|
|
libigl
|
2018-11-06 17:01:18 +00:00
|
|
|
miniz
|
2019-06-13 11:15:10 +00:00
|
|
|
boost_libs
|
2018-11-06 17:01:18 +00:00
|
|
|
clipper
|
2018-09-19 09:02:24 +00:00
|
|
|
nowide
|
2018-11-06 17:01:18 +00:00
|
|
|
${EXPAT_LIBRARIES}
|
2019-02-05 17:14:07 +00:00
|
|
|
glu-libtess
|
2018-11-06 17:01:18 +00:00
|
|
|
polypartition
|
|
|
|
poly2tri
|
2018-09-19 09:02:24 +00:00
|
|
|
qhull
|
|
|
|
semver
|
2019-10-14 10:50:08 +00:00
|
|
|
TBB::tbb
|
2020-01-28 13:49:07 +00:00
|
|
|
libslic3r_cgal
|
2019-09-24 13:15:49 +00:00
|
|
|
${CMAKE_DL_LIBS}
|
2018-09-19 09:02:24 +00:00
|
|
|
)
|
|
|
|
|
2019-11-01 14:31:26 +00:00
|
|
|
if (TARGET OpenVDB::openvdb)
|
|
|
|
target_link_libraries(libslic3r OpenVDB::openvdb)
|
|
|
|
endif()
|
|
|
|
|
2018-12-18 10:31:41 +00:00
|
|
|
if(WIN32)
|
|
|
|
target_link_libraries(libslic3r Psapi.lib)
|
|
|
|
endif()
|
|
|
|
|
2018-09-19 09:02:24 +00:00
|
|
|
if(SLIC3R_PROFILE)
|
2020-05-20 14:28:46 +00:00
|
|
|
target_link_libraries(libslic3r Shiny)
|
2018-09-19 09:02:24 +00:00
|
|
|
endif()
|
2019-11-11 12:56:05 +00:00
|
|
|
|
|
|
|
if (SLIC3R_PCH AND NOT SLIC3R_SYNTAXONLY)
|
|
|
|
add_precompiled_header(libslic3r pchheader.hpp FORCEINCLUDE)
|
|
|
|
endif ()
|