@@ -344,6 +344,10 @@ if (NOT GLEW_FOUND)
endif ()
include_directories(${GLEW_INCLUDE_DIRS})
+# Find the Cereal serialization library
+add_library(cereal INTERFACE)
+target_include_directories(cereal INTERFACE include)
+
# l10n
set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization")
add_custom_target(pot
@@ -89,6 +89,7 @@ if (MSVC)
dep_libcurl
dep_wxwidgets
dep_gtest
+ dep_cereal
dep_nlopt
# dep_qhull # Experimental
dep_zlib # on Windows we still need zlib
@@ -103,6 +104,7 @@ else()
dep_qhull
# dep_libigl # Not working, static build has different Eigen
@@ -19,6 +19,16 @@ ExternalProject_Add(dep_gtest
CMAKE_ARGS -DBUILD_GMOCK=OFF ${DEP_CMAKE_OPTS} -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
)
+ExternalProject_Add(dep_cereal
+ EXCLUDE_FROM_ALL 1
+ URL "https://github.com/USCiLab/cereal/archive/v1.2.2.tar.gz"
+# URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
+ CMAKE_ARGS
+ -DJUST_INSTALL_CEREAL=on
+ -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local
+ ${DEP_CMAKE_OPTS}
+)
ExternalProject_Add(dep_nlopt
EXCLUDE_FROM_ALL 1
URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
@@ -115,6 +115,20 @@ if (${DEP_DEBUG})
+ CMAKE_GENERATOR "${DEP_MSVC_GEN}"
+ CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}"
+ "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
+ BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj
+ INSTALL_COMMAND ""
@@ -20,6 +20,9 @@ You can also customize the bundle output path using the `-DDESTDIR=<some path>`
**Warning**: Once the dependency bundle is installed in a destdir, the destdir cannot be moved elsewhere.
(This is because wxWidgets hardcodes the installation path.)
+FIXME The Cereal serialization library needs a tiny patch on some old OSX clang installations
+https://github.com/USCiLab/cereal/issues/339#issuecomment-246166717
### Building PrusaSlicer
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
+<g id="redo">
+ <path fill="none" stroke="#ED6B21" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M13.39,11
+ c-0.91,1.78-2.76,3-4.89,3C5.46,14,3,11.54,3,8.5C3,5.46,5.46,3,8.5,3C8.67,3,8.84,3.01,9,3.03"/>
+ <polygon fill="#ED6B21" stroke="#ED6B21" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
+ 9,1 9,5 12,3 "/>
+</g>
+</svg>
+ <path fill="none" stroke="#ED6B21" stroke-width="1" stroke-linecap="round" stroke-miterlimit="10" d="M13.39,11
+ <polygon fill="#ED6B21" stroke="#ED6B21" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
+<!-- Generator: Adobe Illustrator 23.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<g id="undo">
+ <path fill="none" stroke="#ED6B21" stroke-width="1" stroke-linecap="round" stroke-miterlimit="10" d="M3,11
+ c0.91,1.78,2.76,3,4.89,3c3.04,0,5.5-2.46,5.5-5.5c0-3.04-2.46-5.5-5.5-5.5c-0.17,0-0.34,0.01-0.5,0.03"/>
+ 7.39,1 7.39,5 4.39,3 "/>
@@ -75,7 +75,7 @@ if (NOT MSVC)
set_target_properties(PrusaSlicer PROPERTIES OUTPUT_NAME "prusa-slicer")
-target_link_libraries(PrusaSlicer libslic3r)
+target_link_libraries(PrusaSlicer libslic3r cereal)
if (APPLE)
# add_compile_options(-stdlib=libc++)
# add_definitions(-DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_NO_CXX11_RVALUE_REFERENCES -DBOOST_THREAD_USES_MOVE)
@@ -132,7 +132,7 @@ struct HashTableEdges {
~HashTableEdges() {
#ifndef NDEBUG
for (int i = 0; i < this->M; ++ i)
- for (HashEdge *temp = this->heads[i]; this->heads[i] != this->tail; temp = this->heads[i])
+ for (HashEdge *temp = this->heads[i]; temp != this->tail; temp = temp->next)
++ this->freed;
this->tail = nullptr;
#endif /* NDEBUG */