2017-08-17 11:30:46 +00:00
|
|
|
# Enable C++11 language standard.
|
2017-08-16 17:05:08 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2017-08-17 11:30:46 +00:00
|
|
|
# Add our own cmake module path.
|
2017-08-16 17:05:08 +00:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/)
|
|
|
|
|
2017-08-17 11:30:46 +00:00
|
|
|
# Where all the bundled libraries reside?
|
2017-08-16 17:05:08 +00:00
|
|
|
set(LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/src/)
|
2017-08-17 11:30:46 +00:00
|
|
|
# For the bundled boost libraries (boost::nowide)
|
2017-08-16 17:05:08 +00:00
|
|
|
include_directories(${LIBDIR})
|
2017-08-18 09:39:24 +00:00
|
|
|
# For libslic3r.h
|
|
|
|
include_directories(${LIBDIR}/libslic3r)
|
|
|
|
#set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
add_definitions(-D_USE_MATH_DEFINES -D_WIN32)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
add_library(libslic3r STATIC
|
|
|
|
${LIBDIR}/libslic3r/BoundingBox.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/BoundingBox.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/BridgeDetector.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/BridgeDetector.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/ClipperUtils.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/ClipperUtils.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Config.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Config.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/EdgeGrid.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/EdgeGrid.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/ExPolygon.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/ExPolygon.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/ExPolygonCollection.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/ExPolygonCollection.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Extruder.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Extruder.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/ExtrusionEntity.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/ExtrusionEntity.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/ExtrusionEntityCollection.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/ExtrusionEntityCollection.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/ExtrusionSimulator.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/ExtrusionSimulator.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/Fill.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/Fill.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/Fill3DHoneycomb.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/Fill3DHoneycomb.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillBase.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillBase.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillConcentric.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillConcentric.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillHoneycomb.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillHoneycomb.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillPlanePath.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillPlanePath.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillRectilinear.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillRectilinear.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillRectilinear2.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillRectilinear2.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillRectilinear3.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillRectilinear3.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Flow.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Flow.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/AMF.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/AMF.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/OBJ.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/OBJ.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/objparser.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/objparser.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/PRUS.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/PRUS.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/STL.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/STL.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/Analyzer.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/Analyzer.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/CoolingBuffer.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/CoolingBuffer.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/PressureEqualizer.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/PressureEqualizer.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/SpiralVase.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/SpiralVase.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/ToolOrdering.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/ToolOrdering.hpp
|
|
|
|
${LIBDIR}/libslic3r/GCode/WipeTower.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/WipeTowerPrusaMM.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/WipeTowerPrusaMM.hpp
|
|
|
|
${LIBDIR}/libslic3r/GCode.cpp
|
|
|
|
${LIBDIR}/libslic3r/GCode.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCodeReader.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCodeReader.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCodeSender.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCodeSender.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCodeTimeEstimator.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCodeTimeEstimator.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/GCodeWriter.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/GCodeWriter.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Geometry.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Geometry.hpp
|
|
|
|
${LIBDIR}/libslic3r/Int128.hpp
|
|
|
|
# ${LIBDIR}/libslic3r/KdTree.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Layer.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Layer.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/LayerRegion.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/libslic3r.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Line.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Line.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Model.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Model.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/MotionPlanner.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/MotionPlanner.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/MultiPoint.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/MultiPoint.hpp
|
|
|
|
${LIBDIR}/libslic3r/MutablePriorityQueue.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/PerimeterGenerator.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/PerimeterGenerator.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/PlaceholderParser.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/PlaceholderParser.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Point.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Point.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Polygon.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Polygon.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Polyline.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Polyline.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/PolylineCollection.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/PolylineCollection.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Print.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Print.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/PrintConfig.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/PrintConfig.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/PrintObject.cpp
|
|
|
|
${LIBDIR}/libslic3r/PrintRegion.cpp
|
|
|
|
${LIBDIR}/libslic3r/Slicing.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Slicing.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/SlicingAdaptive.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/SlicingAdaptive.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/SupportMaterial.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/SupportMaterial.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/Surface.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/Surface.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/SurfaceCollection.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/SurfaceCollection.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/SVG.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/SVG.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/libslic3r/TriangleMesh.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/libslic3r/TriangleMesh.hpp
|
|
|
|
# ${LIBDIR}/libslic3r/utils.cpp
|
|
|
|
${LIBDIR}/libslic3r/Utils.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(libslic3r_gui STATIC
|
|
|
|
${LIBDIR}/slic3r/GUI/3DScene.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/3DScene.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/GLShader.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/GLShader.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/GUI.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/GUI.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(admesh STATIC
|
|
|
|
${LIBDIR}/admesh/connect.cpp
|
|
|
|
${LIBDIR}/admesh/normals.cpp
|
|
|
|
${LIBDIR}/admesh/shared.cpp
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/admesh/stl.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/admesh/stl_io.cpp
|
|
|
|
${LIBDIR}/admesh/stlinit.cpp
|
|
|
|
${LIBDIR}/admesh/util.cpp
|
|
|
|
)
|
|
|
|
|
2017-08-18 10:41:01 +00:00
|
|
|
add_library(clipper STATIC
|
|
|
|
${LIBDIR}/clipper.cpp
|
|
|
|
${LIBDIR}/clipper.hpp
|
|
|
|
)
|
2017-08-18 09:39:24 +00:00
|
|
|
|
2017-08-18 10:41:01 +00:00
|
|
|
add_library(polypartition STATIC
|
|
|
|
${LIBDIR}/polypartition.cpp
|
|
|
|
${LIBDIR}/polypartition.h
|
|
|
|
)
|
2017-08-18 09:39:24 +00:00
|
|
|
|
|
|
|
add_library(poly2tri STATIC
|
|
|
|
${LIBDIR}/poly2tri/common/shapes.cc
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/poly2tri/common/shapes.h
|
|
|
|
${LIBDIR}/poly2tri/common/utils.h
|
|
|
|
${LIBDIR}/poly2tri/poly2tri.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/poly2tri/sweep/advancing_front.cc
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/poly2tri/sweep/advancing_front.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/poly2tri/sweep/cdt.cc
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/poly2tri/sweep/cdt.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/poly2tri/sweep/sweep.cc
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/poly2tri/sweep/sweep.h
|
|
|
|
${LIBDIR}/poly2tri/sweep/sweep_context.cc
|
|
|
|
${LIBDIR}/poly2tri/sweep/sweep_context.h
|
2017-08-18 09:39:24 +00:00
|
|
|
)
|
|
|
|
|
2017-08-18 10:41:01 +00:00
|
|
|
add_library(nowide STATIC
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/boost/nowide/args.hpp
|
|
|
|
${LIBDIR}/boost/nowide/cenv.hpp
|
|
|
|
${LIBDIR}/boost/nowide/config.hpp
|
|
|
|
${LIBDIR}/boost/nowide/convert.hpp
|
|
|
|
${LIBDIR}/boost/nowide/cstdio.hpp
|
|
|
|
${LIBDIR}/boost/nowide/cstdlib.hpp
|
|
|
|
${LIBDIR}/boost/nowide/filebuf.hpp
|
|
|
|
${LIBDIR}/boost/nowide/fstream.hpp
|
|
|
|
${LIBDIR}/boost/nowide/integration/filesystem.hpp
|
|
|
|
${LIBDIR}/boost/nowide/iostream.cpp
|
|
|
|
${LIBDIR}/boost/nowide/iostream.hpp
|
|
|
|
${LIBDIR}/boost/nowide/stackstring.hpp
|
|
|
|
${LIBDIR}/boost/nowide/system.hpp
|
|
|
|
${LIBDIR}/boost/nowide/utf8_codecvt.hpp
|
|
|
|
${LIBDIR}/boost/nowide/windows.hpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(Shiny STATIC
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/Shiny/Shiny.h
|
|
|
|
${LIBDIR}/Shiny/ShinyConfig.h
|
|
|
|
${LIBDIR}/Shiny/ShinyData.h
|
|
|
|
${LIBDIR}/Shiny/ShinyMacros.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyManager.c
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyManager.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyNode.c
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyNode.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyNodePool.c
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyNodePool.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyNodeState.c
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyNodeState.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyOutput.c
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyOutput.h
|
|
|
|
${LIBDIR}/Shiny/ShinyPrereqs.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyTools.c
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyTools.h
|
|
|
|
${LIBDIR}/Shiny/ShinyVersion.h
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyZone.c
|
2017-08-18 10:41:01 +00:00
|
|
|
${LIBDIR}/Shiny/ShinyZone.h
|
2017-08-18 09:39:24 +00:00
|
|
|
)
|
2017-08-16 17:05:08 +00:00
|
|
|
|
2017-08-17 11:30:46 +00:00
|
|
|
# Generate the Slic3r Perl module (XS) typemap file.
|
|
|
|
#FIXME add the dependencies.
|
2017-08-16 17:05:08 +00:00
|
|
|
find_package(Perl REQUIRED)
|
|
|
|
set(MyTypemap ${CMAKE_CURRENT_BINARY_DIR}/typemap)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${MyTypemap}
|
2017-08-18 09:39:24 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/xsp/my.map
|
2017-08-16 17:05:08 +00:00
|
|
|
COMMAND ${PERL_EXECUTABLE} -MExtUtils::Typemaps -MExtUtils::Typemaps::Basic -e "$typemap = ExtUtils::Typemaps->new(file => \"${CMAKE_CURRENT_LIST_DIR}/xsp/my.map\"); $typemap->merge(typemap => ExtUtils::Typemaps::Basic->new); $typemap->write(file => \"${MyTypemap}\")"
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
|
2017-08-17 11:30:46 +00:00
|
|
|
# Generate the Slic3r Perl module (XS) main.xs file.
|
2017-08-18 09:39:24 +00:00
|
|
|
set(XS_MAIN_XS ${CMAKE_CURRENT_BINARY_DIR}/main.xs)
|
2017-08-17 11:30:46 +00:00
|
|
|
#FIXME list the dependecies explicitely, add dependency on the typemap.
|
2017-08-18 10:41:01 +00:00
|
|
|
file(GLOB XS_XSP_FILES
|
2017-08-18 09:39:24 +00:00
|
|
|
${LIBDIR}/xsp/BoundingBox.xsp
|
|
|
|
${LIBDIR}/xsp/BridgeDetector.xsp
|
|
|
|
${LIBDIR}/xsp/Clipper.xsp
|
|
|
|
${LIBDIR}/xsp/Config.xsp
|
|
|
|
${LIBDIR}/xsp/ExPolygon.xsp
|
|
|
|
${LIBDIR}/xsp/ExPolygonCollection.xsp
|
|
|
|
${LIBDIR}/xsp/ExtrusionEntityCollection.xsp
|
|
|
|
${LIBDIR}/xsp/ExtrusionLoop.xsp
|
|
|
|
${LIBDIR}/xsp/ExtrusionMultiPath.xsp
|
|
|
|
${LIBDIR}/xsp/ExtrusionPath.xsp
|
|
|
|
${LIBDIR}/xsp/ExtrusionSimulator.xsp
|
|
|
|
${LIBDIR}/xsp/Filler.xsp
|
|
|
|
${LIBDIR}/xsp/Flow.xsp
|
|
|
|
${LIBDIR}/xsp/GCode.xsp
|
|
|
|
${LIBDIR}/xsp/GCodeSender.xsp
|
|
|
|
${LIBDIR}/xsp/Geometry.xsp
|
|
|
|
${LIBDIR}/xsp/GUI.xsp
|
|
|
|
${LIBDIR}/xsp/GUI_3DScene.xsp
|
|
|
|
${LIBDIR}/xsp/Layer.xsp
|
|
|
|
${LIBDIR}/xsp/Line.xsp
|
|
|
|
${LIBDIR}/xsp/Model.xsp
|
|
|
|
${LIBDIR}/xsp/MotionPlanner.xsp
|
|
|
|
${LIBDIR}/xsp/PerimeterGenerator.xsp
|
|
|
|
${LIBDIR}/xsp/PlaceholderParser.xsp
|
|
|
|
${LIBDIR}/xsp/Point.xsp
|
|
|
|
${LIBDIR}/xsp/Polygon.xsp
|
|
|
|
${LIBDIR}/xsp/Polyline.xsp
|
|
|
|
${LIBDIR}/xsp/PolylineCollection.xsp
|
|
|
|
${LIBDIR}/xsp/Print.xsp
|
|
|
|
${LIBDIR}/xsp/Surface.xsp
|
|
|
|
${LIBDIR}/xsp/SurfaceCollection.xsp
|
|
|
|
${LIBDIR}/xsp/TriangleMesh.xsp
|
|
|
|
${LIBDIR}/xsp/XS.xsp
|
|
|
|
)
|
|
|
|
foreach (file ${XS_XSP_FILES})
|
2017-08-16 17:05:08 +00:00
|
|
|
if (MSVC)
|
|
|
|
# Visual Studio C compiler has issues with FILE pragmas containing quotes.
|
|
|
|
set(INCLUDE_COMMANDS "${INCLUDE_COMMANDS}INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t ${CMAKE_CURRENT_LIST_DIR}/xsp/typemap.xspt ${file}\n")
|
|
|
|
else ()
|
|
|
|
set(INCLUDE_COMMANDS "${INCLUDE_COMMANDS}INCLUDE_COMMAND: $^X -MExtUtils::XSpp::Cmd -e xspp -- -t \"${CMAKE_CURRENT_LIST_DIR}/xsp/typemap.xspt\" \"${file}\"\n")
|
|
|
|
endif ()
|
|
|
|
endforeach ()
|
2017-08-18 09:39:24 +00:00
|
|
|
configure_file(main.xs.in ${XS_MAIN_XS} @ONLY) # Insert INCLUDE_COMMANDS into main.xs
|
2017-08-16 17:05:08 +00:00
|
|
|
|
2017-08-17 11:30:46 +00:00
|
|
|
# Generate the Slic3r Perl module (XS) XS.cpp file.
|
|
|
|
#FIXME add the dependency on main.xs and typemap.
|
2017-08-18 09:39:24 +00:00
|
|
|
set(XS_MAIN_CPP ${CMAKE_CURRENT_BINARY_DIR}/XS.cpp)
|
2017-08-16 17:05:08 +00:00
|
|
|
add_custom_command(
|
2017-08-18 09:39:24 +00:00
|
|
|
OUTPUT ${XS_MAIN_CPP}
|
2017-08-16 17:05:08 +00:00
|
|
|
DEPENDS ${MyTemplate} ${MyTypemap}
|
2017-08-18 09:39:24 +00:00
|
|
|
COMMAND COMMAND xsubpp -typemap typemap -output ${XS_MAIN_CPP} -hiertype ${XS_MAIN_XS}
|
2017-08-16 17:05:08 +00:00
|
|
|
)
|
|
|
|
|
2017-08-18 09:39:24 +00:00
|
|
|
# Define the Perl XS shared library.
|
2017-08-18 10:41:01 +00:00
|
|
|
add_library(XS SHARED
|
2017-08-18 09:39:24 +00:00
|
|
|
${XS_MAIN_CPP}
|
|
|
|
${LIBDIR}/perlglue.cpp
|
|
|
|
${LIBDIR}/libslic3r/utils.cpp
|
|
|
|
)
|
|
|
|
target_link_libraries(XS libslic3r libslic3r_gui admesh clipper nowide polypartition poly2tri)
|
|
|
|
if(SLIC3R_DEBUG)
|
|
|
|
target_link_libraries(Shiny)
|
|
|
|
endif()
|
2017-08-16 17:05:08 +00:00
|
|
|
|
|
|
|
# Add the OpenGL and GLU libraries.
|
|
|
|
if (SLIC3R_GUI)
|
|
|
|
if (MSVC)
|
|
|
|
target_link_libraries(XS OpenGL32.Lib GlU32.Lib)
|
|
|
|
elseif (MINGW)
|
|
|
|
target_link_libraries(XS -lopengl32)
|
|
|
|
elseif (APPLE)
|
|
|
|
target_link_libraries(XS -framework OpenGL)
|
|
|
|
else ()
|
|
|
|
target_link_libraries(XS -lGL -lGLU)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
target_include_directories(XS PRIVATE src src/libslic3r) # Local include directories
|
|
|
|
target_compile_definitions(XS PRIVATE -DSLIC3RXS)
|
|
|
|
set_target_properties(XS PROPERTIES PREFIX "") # Prevent cmake from generating libXS.so instead of XS.so
|
|
|
|
|
|
|
|
if (APPLE)
|
2017-08-17 16:27:51 +00:00
|
|
|
# add_compile_options(-stdlib=libc++)
|
|
|
|
# add_definitions(-DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_NO_CXX11_RVALUE_REFERENCES -DBOOST_THREAD_USES_MOVE)
|
2017-08-16 17:05:08 +00:00
|
|
|
target_link_libraries(XS -framework IOKit -framework CoreFoundation -lc++)
|
|
|
|
elseif (MSVC)
|
|
|
|
target_link_libraries(XS )
|
|
|
|
else ()
|
2017-08-17 16:27:51 +00:00
|
|
|
target_link_libraries(XS -lstdc++)
|
2017-08-16 17:05:08 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
# Windows specific stuff
|
|
|
|
if (WIN32)
|
2017-08-18 09:39:24 +00:00
|
|
|
target_compile_definitions(XS PRIVATE -DNOGDI -DNOMINMAX -DHAS_BOOL)
|
2017-08-16 17:05:08 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
## Configuration flags
|
|
|
|
if (SLIC3R_GUI)
|
|
|
|
message("Slic3r will be built with GUI support")
|
|
|
|
target_compile_definitions(XS PRIVATE -DSLIC3R_GUI)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (SLIC3R_PROFILE)
|
|
|
|
message("Slic3r will be built with a Shiny invasive profiler")
|
|
|
|
target_compile_definitions(XS PRIVATE -DSLIC3R_PROFILE)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (SLIC3R_HAS_BROKEN_CROAK)
|
|
|
|
target_compile_definitions(XS PRIVATE -DSLIC3R_HAS_BROKEN_CROAK)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (CMAKE_BUILD_TYPE MATCHES DEBUG)
|
|
|
|
target_compile_definitions(XS PRIVATE -DSLIC3R_DEBUG -DDEBUG -D_DEBUG)
|
|
|
|
else ()
|
|
|
|
target_compile_definitions(XS PRIVATE -DNDEBUG)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
# Perl specific stuff
|
|
|
|
find_package(PerlLibs REQUIRED)
|
2017-08-17 11:30:46 +00:00
|
|
|
set(PerlEmbed_DEBUG 1)
|
|
|
|
find_package(PerlEmbed REQUIRED)
|
2017-08-16 17:05:08 +00:00
|
|
|
target_include_directories(XS PRIVATE ${PERL_INCLUDE_PATH})
|
2017-08-17 16:27:51 +00:00
|
|
|
target_compile_options(XS PRIVATE ${PerlEmbed_CCFLAGS})
|
|
|
|
# If the Perl is compiled with optimization off, disable optimization over the whole project.
|
2017-08-17 17:43:14 +00:00
|
|
|
#if ("-Od" IN_LIST PerlEmbed_CCFLAGS OR "/Od" IN_LIST PerlEmbed_CCFLAGS)
|
|
|
|
# set(CMAKE_CXX_FLAGS_RELEASE /Od)
|
|
|
|
# set(CMAKE_C_FLAGS_RELEASE /Od)
|
|
|
|
#endif()
|
2017-08-17 11:30:46 +00:00
|
|
|
target_link_libraries(XS ${PERL_LIBRARY})
|
2017-08-16 17:05:08 +00:00
|
|
|
|
|
|
|
## REQUIRED packages
|
|
|
|
|
|
|
|
# Find and configure boost
|
|
|
|
if (SLIC3R_STATIC)
|
|
|
|
# Use static boost libraries.
|
|
|
|
set(Boost_USE_STATIC_LIBS ON)
|
|
|
|
# Use boost libraries linked statically to the C++ runtime.
|
|
|
|
# set(Boost_USE_STATIC_RUNTIME ON)
|
|
|
|
endif ()
|
|
|
|
find_package(Boost REQUIRED COMPONENTS system filesystem thread log locale)
|
|
|
|
if (Boost_FOUND)
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(XS ${Boost_LIBRARIES})
|
|
|
|
target_compile_definitions(XS PRIVATE -DBOOST_ASIO_DISABLE_KQUEUE -DBOOST_LIBS -DBOOST_ALL_NO_LIB)
|
|
|
|
if (NOT SLIC3R_STATIC)
|
|
|
|
target_compile_definitions(XS PRIVATE -DBOOST_LOG_DYN_LINK)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
# Find and configure intel-tbb
|
2017-08-17 16:27:51 +00:00
|
|
|
if(SLIC3R_STATIC)
|
|
|
|
set(TBB_STATIC 1)
|
|
|
|
endif()
|
|
|
|
set(TBB_DEBUG 1)
|
2017-08-16 17:05:08 +00:00
|
|
|
find_package(TBB REQUIRED)
|
2017-08-17 16:27:51 +00:00
|
|
|
include_directories(${TBB_INCLUDE_DIRS})
|
|
|
|
add_definitions(${TBB_DEFINITIONS})
|
|
|
|
if(MSVC)
|
|
|
|
# Suppress implicit linking of the TBB libraries by the Visual Studio compiler.
|
|
|
|
add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE)
|
|
|
|
endif()
|
|
|
|
target_link_libraries(XS ${TBB_LIBRARIES})
|
2017-08-16 17:05:08 +00:00
|
|
|
|
|
|
|
# Find and configure wxWidgets
|
2017-08-17 11:30:46 +00:00
|
|
|
if (SLIC3R_PRUSACONTROL)
|
|
|
|
set(wxWidgets_UseAlienWx 1)
|
|
|
|
if (wxWidgets_UseAlienWx)
|
|
|
|
set(AlienWx_DEBUG 1)
|
|
|
|
find_package(AlienWx REQUIRED COMPONENTS base)
|
2017-08-17 16:27:51 +00:00
|
|
|
include_directories(${AlienWx_INCLUDE_DIRS})
|
|
|
|
#add_compile_options(${AlienWx_CXX_FLAGS})
|
2017-08-17 11:30:46 +00:00
|
|
|
add_definitions(${AlienWx_DEFINITIONS})
|
|
|
|
target_link_libraries(XS ${AlienWx_LIBRARIES})
|
|
|
|
else ()
|
|
|
|
find_package(wxWidgets REQUIRED COMPONENTS base)
|
2017-08-16 17:05:08 +00:00
|
|
|
include(${wxWidgets_USE_FILE})
|
|
|
|
target_link_libraries(XS ${wxWidgets_LIBRARIES})
|
|
|
|
endif ()
|
2017-08-17 11:30:46 +00:00
|
|
|
target_compile_definitions(XS PRIVATE -DSLIC3R_GUI -DSLIC3R_PRUS)
|
|
|
|
endif()
|
2017-08-16 17:05:08 +00:00
|
|
|
|
|
|
|
## OPTIONAL packages
|
|
|
|
|
|
|
|
# Find eigen3 or use bundled version
|
|
|
|
if (NOT SLIC3R_STATIC)
|
|
|
|
find_package(Eigen3)
|
|
|
|
endif ()
|
|
|
|
if (NOT Eigen3_FOUND)
|
|
|
|
set(Eigen3_FOUND 1)
|
|
|
|
set(EIGEN3_INCLUDE_DIR ${LIBDIR}/eigen/)
|
|
|
|
endif ()
|
|
|
|
include_directories(${EIGEN3_INCLUDE_DIR})
|
|
|
|
|
|
|
|
# Find expat or use bundled version
|
2017-08-17 16:33:15 +00:00
|
|
|
# Always use the system libexpat on Linux.
|
|
|
|
if (NOT SLIC3R_STATIC OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
2017-08-16 17:05:08 +00:00
|
|
|
find_package(EXPAT)
|
|
|
|
endif ()
|
|
|
|
if (NOT EXPAT_FOUND)
|
|
|
|
add_library(expat STATIC
|
|
|
|
${LIBDIR}/expat/xmlparse.c
|
|
|
|
${LIBDIR}/expat/xmlrole.c
|
|
|
|
${LIBDIR}/expat/xmltok.c
|
|
|
|
)
|
|
|
|
set(EXPAT_FOUND 1)
|
|
|
|
set(EXPAT_INCLUDE_DIRS ${LIBDIR}/expat/)
|
|
|
|
set(EXPAT_LIBRARIES expat)
|
|
|
|
endif ()
|
|
|
|
include_directories(${EXPAT_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(XS ${EXPAT_LIBRARIES})
|
|
|
|
|
|
|
|
# Find glew or use bundled version
|
|
|
|
if (NOT SLIC3R_STATIC)
|
|
|
|
find_package(GLEW)
|
|
|
|
endif ()
|
|
|
|
if (NOT GLEW_FOUND)
|
|
|
|
add_library(glew STATIC ${LIBDIR}/glew/src/glew.c)
|
|
|
|
set(GLEW_FOUND 1)
|
|
|
|
set(GLEW_INCLUDE_DIRS ${LIBDIR}/glew/include/)
|
|
|
|
set(GLEW_LIBRARIES glew)
|
|
|
|
target_compile_definitions(glew PRIVATE -DGLEW_STATIC)
|
|
|
|
target_compile_definitions(XS PRIVATE -DGLEW_STATIC)
|
|
|
|
endif ()
|
|
|
|
include_directories(${GLEW_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(XS ${GLEW_LIBRARIES})
|
|
|
|
|
|
|
|
# Installation
|
|
|
|
install(TARGETS XS DESTINATION lib/slic3r-prusa3d/auto/Slic3r/XS)
|
|
|
|
install(FILES lib/Slic3r/XS.pm DESTINATION lib/slic3r-prusa3d/Slic3r)
|