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-28 21:17:24 +00:00
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
2017-08-28 21:11:43 +00:00
|
|
|
# Workaround for an old CMake, which does not understand CMAKE_CXX_STANDARD.
|
2017-08-28 21:17:24 +00:00
|
|
|
add_compile_options(-std=c++11 -Wall)
|
2017-08-28 21:11:43 +00:00
|
|
|
endif()
|
|
|
|
|
2017-09-11 07:20:22 +00:00
|
|
|
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
|
|
|
|
# Adding -fext-numeric-literals to enable GCC extensions on definitions of quad float literals, which are required by Boost.
|
|
|
|
add_compile_options(-fext-numeric-literals)
|
|
|
|
endif()
|
|
|
|
|
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)
|
|
|
|
|
2017-08-18 19:09:53 +00:00
|
|
|
if(WIN32)
|
|
|
|
# BOOST_ALL_NO_LIB: Avoid the automatic linking of Boost libraries on Windows. Rather rely on explicit linking.
|
|
|
|
add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -DBOOST_ALL_NO_LIB)
|
2017-11-09 09:48:06 +00:00
|
|
|
# -D_ITERATOR_DEBUG_LEVEL)
|
2017-08-18 19:09:53 +00:00
|
|
|
endif()
|
2017-08-18 09:39:24 +00:00
|
|
|
|
2017-09-19 11:55:48 +00:00
|
|
|
add_definitions(-DwxUSE_UNICODE -D_UNICODE -DUNICODE)
|
|
|
|
|
2017-08-18 09:39:24 +00:00
|
|
|
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
|
2018-02-22 08:56:05 +00:00
|
|
|
${LIBDIR}/libslic3r/Fill/FillGyroid.cpp
|
|
|
|
${LIBDIR}/libslic3r/Fill/FillGyroid.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
|
2018-02-02 14:03:06 +00:00
|
|
|
${LIBDIR}/libslic3r/Format/3mf.cpp
|
|
|
|
${LIBDIR}/libslic3r/Format/3mf.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
|
2018-02-14 17:42:09 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/PreviewData.cpp
|
|
|
|
${LIBDIR}/libslic3r/GCode/PreviewData.hpp
|
2017-09-12 07:01:48 +00:00
|
|
|
${LIBDIR}/libslic3r/GCode/PrintExtents.cpp
|
|
|
|
${LIBDIR}/libslic3r/GCode/PrintExtents.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
|
2017-10-30 17:15:41 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/AppConfig.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/AppConfig.hpp
|
2017-08-18 09:39:24 +00:00
|
|
|
${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
|
2018-02-23 14:53:16 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/Preferences.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/Preferences.hpp
|
2017-09-19 11:55:48 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/Preset.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/Preset.hpp
|
2017-11-01 18:30:05 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/PresetBundle.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/PresetBundle.hpp
|
2017-11-09 09:48:06 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/PresetHints.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/PresetHints.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-12-26 22:04:54 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/Tab.cpp
|
2018-01-23 10:42:04 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/Tab.hpp
|
2018-01-23 10:37:19 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/TabIface.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/TabIface.hpp
|
2017-12-26 22:04:54 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/Field.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/Field.hpp
|
|
|
|
${LIBDIR}/slic3r/GUI/OptionsGroup.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/OptionsGroup.hpp
|
2018-01-25 12:46:04 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/BedShapeDialog.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/BedShapeDialog.hpp
|
|
|
|
${LIBDIR}/slic3r/GUI/2DBed.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/2DBed.hpp
|
2018-02-02 11:38:35 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/wxExtensions.cpp
|
|
|
|
${LIBDIR}/slic3r/GUI/wxExtensions.hpp
|
2018-02-07 10:37:15 +00:00
|
|
|
${LIBDIR}/slic3r/Utils/Http.cpp
|
|
|
|
${LIBDIR}/slic3r/Utils/Http.hpp
|
2018-02-07 10:37:15 +00:00
|
|
|
${LIBDIR}/slic3r/Utils/OctoPrint.cpp
|
|
|
|
${LIBDIR}/slic3r/Utils/OctoPrint.hpp
|
2018-02-20 14:37:26 +00:00
|
|
|
${LIBDIR}/slic3r/Utils/Bonjour.cpp
|
|
|
|
${LIBDIR}/slic3r/Utils/Bonjour.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
|
|
|
|
)
|
|
|
|
|
2018-01-30 07:48:58 +00:00
|
|
|
add_library(miniz STATIC
|
|
|
|
${LIBDIR}/miniz/miniz.h
|
|
|
|
${LIBDIR}/miniz/miniz_common.h
|
|
|
|
${LIBDIR}/miniz/miniz_tdef.h
|
|
|
|
${LIBDIR}/miniz/miniz_tinfl.h
|
|
|
|
${LIBDIR}/miniz/miniz_zip.h
|
|
|
|
${LIBDIR}/miniz/miniz.cpp
|
|
|
|
${LIBDIR}/miniz/miniz_tdef.cpp
|
|
|
|
${LIBDIR}/miniz/miniz_tinfl.cpp
|
|
|
|
${LIBDIR}/miniz/miniz_zip.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-18 12:34:54 +00:00
|
|
|
# Generate the Slic3r Perl module (XS) typemap file.
|
2017-08-16 17:05:08 +00:00
|
|
|
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-18 19:09:53 +00:00
|
|
|
set(XSP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xsp)
|
2017-08-17 11:30:46 +00:00
|
|
|
#FIXME list the dependecies explicitely, add dependency on the typemap.
|
2017-08-18 19:09:53 +00:00
|
|
|
set(XS_XSP_FILES
|
|
|
|
${XSP_DIR}/BoundingBox.xsp
|
|
|
|
${XSP_DIR}/BridgeDetector.xsp
|
|
|
|
${XSP_DIR}/Clipper.xsp
|
|
|
|
${XSP_DIR}/Config.xsp
|
|
|
|
${XSP_DIR}/ExPolygon.xsp
|
|
|
|
${XSP_DIR}/ExPolygonCollection.xsp
|
|
|
|
${XSP_DIR}/ExtrusionEntityCollection.xsp
|
|
|
|
${XSP_DIR}/ExtrusionLoop.xsp
|
|
|
|
${XSP_DIR}/ExtrusionMultiPath.xsp
|
|
|
|
${XSP_DIR}/ExtrusionPath.xsp
|
|
|
|
${XSP_DIR}/ExtrusionSimulator.xsp
|
|
|
|
${XSP_DIR}/Filler.xsp
|
|
|
|
${XSP_DIR}/Flow.xsp
|
|
|
|
${XSP_DIR}/GCode.xsp
|
|
|
|
${XSP_DIR}/GCodeSender.xsp
|
|
|
|
${XSP_DIR}/Geometry.xsp
|
|
|
|
${XSP_DIR}/GUI.xsp
|
2017-10-30 17:15:41 +00:00
|
|
|
${XSP_DIR}/GUI_AppConfig.xsp
|
2017-08-18 19:09:53 +00:00
|
|
|
${XSP_DIR}/GUI_3DScene.xsp
|
2017-09-19 11:55:48 +00:00
|
|
|
${XSP_DIR}/GUI_Preset.xsp
|
2018-01-23 10:37:19 +00:00
|
|
|
${XSP_DIR}/GUI_Tab.xsp
|
2017-08-18 19:09:53 +00:00
|
|
|
${XSP_DIR}/Layer.xsp
|
|
|
|
${XSP_DIR}/Line.xsp
|
|
|
|
${XSP_DIR}/Model.xsp
|
|
|
|
${XSP_DIR}/MotionPlanner.xsp
|
|
|
|
${XSP_DIR}/PerimeterGenerator.xsp
|
|
|
|
${XSP_DIR}/PlaceholderParser.xsp
|
|
|
|
${XSP_DIR}/Point.xsp
|
|
|
|
${XSP_DIR}/Polygon.xsp
|
|
|
|
${XSP_DIR}/Polyline.xsp
|
|
|
|
${XSP_DIR}/PolylineCollection.xsp
|
|
|
|
${XSP_DIR}/Print.xsp
|
|
|
|
${XSP_DIR}/Surface.xsp
|
|
|
|
${XSP_DIR}/SurfaceCollection.xsp
|
|
|
|
${XSP_DIR}/TriangleMesh.xsp
|
2018-02-07 10:37:15 +00:00
|
|
|
${XSP_DIR}/Utils_OctoPrint.xsp
|
2017-08-18 19:09:53 +00:00
|
|
|
${XSP_DIR}/XS.xsp
|
2017-08-18 09:39:24 +00:00
|
|
|
)
|
|
|
|
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-18 19:09:53 +00:00
|
|
|
DEPENDS ${MyTypemap} ${XS_XSP_FILES} ${CMAKE_CURRENT_LIST_DIR}/xsp/typemap.xspt
|
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 20:06:10 +00:00
|
|
|
if(APPLE)
|
|
|
|
set(XS_SHARED_LIBRARY_TYPE MODULE)
|
|
|
|
else()
|
|
|
|
set(XS_SHARED_LIBRARY_TYPE SHARED)
|
|
|
|
endif()
|
|
|
|
add_library(XS ${XS_SHARED_LIBRARY_TYPE}
|
2017-08-18 09:39:24 +00:00
|
|
|
${XS_MAIN_CPP}
|
|
|
|
${LIBDIR}/libslic3r/utils.cpp
|
2017-10-17 18:00:15 +00:00
|
|
|
${LIBDIR}/slic3r/GUI/wxPerlIface.cpp
|
2017-08-18 11:32:35 +00:00
|
|
|
${LIBDIR}/perlglue.cpp
|
|
|
|
${LIBDIR}/ppport.h
|
|
|
|
${LIBDIR}/xsinit.h
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xsp/my.map
|
|
|
|
# mytype.map is empty. Is it required by Build.PL or the Perl xspp module?
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xsp/mytype.map
|
|
|
|
# Used by Perl xsubpp to generate XS.cpp
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/xsp/typemap.xspt
|
2017-08-18 09:39:24 +00:00
|
|
|
)
|
2017-08-18 20:06:10 +00:00
|
|
|
if(APPLE)
|
|
|
|
set_target_properties(XS PROPERTIES BUNDLE TRUE)
|
|
|
|
# Ignore undefined symbols of the perl interpreter, they will be found in the caller image.
|
|
|
|
target_link_libraries(XS "-undefined dynamic_lookup")
|
|
|
|
endif()
|
2018-01-30 07:48:58 +00:00
|
|
|
target_link_libraries(XS libslic3r libslic3r_gui admesh miniz clipper nowide polypartition poly2tri)
|
2018-01-03 16:29:49 +00:00
|
|
|
if(SLIC3R_PROFILE)
|
|
|
|
target_link_libraries(XS Shiny)
|
2017-08-18 09:39:24 +00:00
|
|
|
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)
|
2017-08-18 14:59:36 +00:00
|
|
|
target_link_libraries(XS "-framework OpenGL")
|
2017-08-16 17:05:08 +00:00
|
|
|
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-18 14:59:36 +00:00
|
|
|
target_link_libraries(XS "-framework IOKit" "-framework CoreFoundation" -lc++)
|
2017-08-16 17:05:08 +00:00
|
|
|
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")
|
2018-01-03 16:29:49 +00:00
|
|
|
add_definitions(-DSLIC3R_PROFILE)
|
2017-08-16 17:05:08 +00:00
|
|
|
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-30 12:57:13 +00:00
|
|
|
if (WIN32 AND ";${PerlEmbed_CCFLAGS};" MATCHES ";[-/]Od;")
|
|
|
|
message(STATUS "Perl compiled without optimization. Disabling optimization for the Slic3r build.")
|
2017-09-01 15:30:18 +00:00
|
|
|
message("Old CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
message("Old CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
message("Old CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS_RELEASE}")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "/MD /Od /Zi /EHsc /DNDEBUG")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "/MD /Od /Zi /DNDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /EHsc /DNDEBUG")
|
|
|
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /DNDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS "/MD /Od /Zi /EHsc /DNDEBUG")
|
|
|
|
set(CMAKE_C_FLAGS "/MD /Od /Zi /DNDEBUG")
|
2017-08-30 12:57:13 +00:00
|
|
|
endif()
|
2017-08-18 20:45:24 +00:00
|
|
|
# The following line will add -fPIC on Linux to make the XS.so rellocable.
|
|
|
|
add_definitions(${PerlEmbed_CCCDLFLAGS})
|
2017-08-29 10:41:59 +00:00
|
|
|
if (WIN32)
|
2017-08-18 20:06:10 +00:00
|
|
|
target_link_libraries(XS ${PERL_LIBRARY})
|
|
|
|
endif()
|
2017-08-16 17:05:08 +00:00
|
|
|
|
|
|
|
## REQUIRED packages
|
|
|
|
|
|
|
|
# Find and configure boost
|
2017-08-18 19:09:53 +00:00
|
|
|
if(SLIC3R_STATIC)
|
2017-08-16 17:05:08 +00:00
|
|
|
# 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)
|
2017-08-18 19:09:53 +00:00
|
|
|
endif()
|
2018-03-02 22:11:57 +00:00
|
|
|
#set(Boost_DEBUG ON)
|
2017-12-20 21:13:19 +00:00
|
|
|
find_package(Boost REQUIRED COMPONENTS system filesystem thread log locale regex)
|
2017-08-18 19:09:53 +00:00
|
|
|
if(Boost_FOUND)
|
2017-08-16 17:05:08 +00:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(XS ${Boost_LIBRARIES})
|
2017-08-18 19:09:53 +00:00
|
|
|
if (APPLE)
|
|
|
|
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
|
|
|
|
add_definitions(-DBOOST_ASIO_DISABLE_KQUEUE)
|
|
|
|
endif()
|
|
|
|
if(NOT SLIC3R_STATIC)
|
|
|
|
add_definitions(-DBOOST_LOG_DYN_LINK)
|
|
|
|
endif()
|
|
|
|
endif()
|
2017-08-16 17:05:08 +00:00
|
|
|
|
|
|
|
# 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()
|
2017-09-01 15:30:18 +00:00
|
|
|
# The Intel TBB library will use the std::exception_ptr feature of C++11.
|
|
|
|
add_definitions(-DTBB_USE_CAPTURED_EXCEPTION=0)
|
2017-08-17 16:27:51 +00:00
|
|
|
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)
|
2017-09-19 11:55:48 +00:00
|
|
|
find_package(AlienWx REQUIRED COMPONENTS base core adv)
|
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})
|
2017-08-18 19:09:53 +00:00
|
|
|
set(wxWidgets_LIBRARIES ${AlienWx_LIBRARIES})
|
2017-08-17 11:30:46 +00:00
|
|
|
else ()
|
2017-09-19 11:55:48 +00:00
|
|
|
find_package(wxWidgets REQUIRED COMPONENTS base core adv)
|
2017-08-16 17:05:08 +00:00
|
|
|
include(${wxWidgets_USE_FILE})
|
|
|
|
endif ()
|
2017-08-18 19:09:53 +00:00
|
|
|
add_definitions(-DSLIC3R_GUI -DSLIC3R_PRUS)
|
2017-08-18 11:32:35 +00:00
|
|
|
target_link_libraries(XS ${wxWidgets_LIBRARIES})
|
2017-08-17 11:30:46 +00:00
|
|
|
endif()
|
2017-08-16 17:05:08 +00:00
|
|
|
|
2018-02-07 10:37:15 +00:00
|
|
|
find_package(CURL REQUIRED)
|
|
|
|
include_directories(${CURL_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(XS ${CURL_LIBRARIES})
|
|
|
|
|
2018-03-06 10:39:24 +00:00
|
|
|
if (SLIC3R_STATIC)
|
|
|
|
if (NOT APPLE)
|
|
|
|
# libcurl is always linked dynamically to the system libcurl on OSX.
|
|
|
|
# On other systems, libcurl is linked statically if SLIC3R_STATIC is set.
|
|
|
|
add_definitions(-DCURL_STATICLIB)
|
|
|
|
endif()
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
# As of now, our build system produces a statically linked libcurl,
|
|
|
|
# which links the OpenSSL library dynamically.
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
|
|
|
|
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
|
|
|
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
|
|
|
target_link_libraries(XS ${OPENSSL_LIBRARIES})
|
|
|
|
endif()
|
2018-03-02 20:16:00 +00:00
|
|
|
endif()
|
2018-02-07 10:37:15 +00:00
|
|
|
|
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)
|
2017-08-18 19:09:53 +00:00
|
|
|
add_definitions(-DGLEW_STATIC)
|
2017-08-16 17:05:08 +00:00
|
|
|
endif ()
|
|
|
|
include_directories(${GLEW_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(XS ${GLEW_LIBRARIES})
|
2017-08-28 17:11:16 +00:00
|
|
|
# Install the XS.pm and XS.{so,dll,bundle} into the local-lib directory.
|
|
|
|
set(PERL_LOCAL_LIB_DIR "${PROJECT_SOURCE_DIR}/local-lib/lib/perl5/${PerlEmbed_ARCHNAME}")
|
|
|
|
add_custom_command(
|
|
|
|
TARGET XS
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${PERL_LOCAL_LIB_DIR}/auto/Slic3r/XS/"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:XS>" "${PERL_LOCAL_LIB_DIR}/auto/Slic3r/XS/"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${PERL_LOCAL_LIB_DIR}/Slic3r/"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/xs/lib/Slic3r/XS.pm" "${PERL_LOCAL_LIB_DIR}/Slic3r/"
|
|
|
|
)
|
2017-08-29 14:37:46 +00:00
|
|
|
if(APPLE)
|
|
|
|
add_custom_command(
|
|
|
|
TARGET XS
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E rename "${PERL_LOCAL_LIB_DIR}/auto/Slic3r/XS/XS" "${PERL_LOCAL_LIB_DIR}/auto/Slic3r/XS/XS.bundle"
|
|
|
|
)
|
|
|
|
endif()
|
2017-08-18 11:32:35 +00:00
|
|
|
|
|
|
|
# Create a slic3r executable
|
|
|
|
add_executable(slic3r ${PROJECT_SOURCE_DIR}/src/slic3r.cpp)
|
|
|
|
target_include_directories(XS PRIVATE src src/libslic3r)
|
2018-01-30 07:48:58 +00:00
|
|
|
target_link_libraries(slic3r libslic3r libslic3r_gui admesh miniz ${Boost_LIBRARIES} clipper ${EXPAT_LIBRARIES} ${GLEW_LIBRARIES} polypartition poly2tri ${TBB_LIBRARIES} ${wxWidgets_LIBRARIES})
|
2018-01-03 16:29:49 +00:00
|
|
|
if(SLIC3R_PROFILE)
|
2017-08-18 11:32:35 +00:00
|
|
|
target_link_libraries(Shiny)
|
|
|
|
endif()
|
|
|
|
if (APPLE)
|
2017-08-18 14:59:36 +00:00
|
|
|
target_link_libraries(slic3r "-framework IOKit" "-framework CoreFoundation" -lc++)
|
2017-08-18 11:32:35 +00:00
|
|
|
elseif (NOT MSVC)
|
|
|
|
target_link_libraries(slic3r -lstdc++)
|
|
|
|
endif ()
|
|
|
|
|
2018-02-23 15:48:11 +00:00
|
|
|
if (MSVC)
|
2018-03-12 08:39:32 +00:00
|
|
|
# Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box.
|
|
|
|
set_target_properties(XS PROPERTIES VS_USER_PROPS "${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl64d.props")
|
|
|
|
endif()
|
2018-02-23 15:48:11 +00:00
|
|
|
|
|
|
|
|
2017-08-16 17:05:08 +00:00
|
|
|
# Installation
|
2018-03-05 17:32:09 +00:00
|
|
|
install(TARGETS XS DESTINATION ${PERL_VENDORARCH}/auto/Slic3r/XS)
|
|
|
|
install(FILES lib/Slic3r/XS.pm DESTINATION ${PERL_VENDORLIB}/Slic3r)
|