From cc788ebb643b6d4048f3550235ac3e9d3697ada0 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Tue, 22 Feb 2022 11:36:27 +0100 Subject: [PATCH] Fix and merge PR #7809 --- CMakeLists.txt | 7 +++++-- src/CMakeLists.txt | 2 +- src/libslic3r/CMakeLists.txt | 2 +- src/slic3r/CMakeLists.txt | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba458ec96..6c6afe671 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -506,9 +506,12 @@ endif () # Find the Cereal serialization library find_package(cereal REQUIRED) +add_library(libcereal INTERFACE) if (NOT TARGET cereal::cereal) - add_library(cereal::cereal ALIAS cereal) -endif () + target_link_libraries(libcereal INTERFACE cereal) +else() + target_link_libraries(libcereal INTERFACE cereal::cereal) +endif() # l10n set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bd5eb94a5..61a2a90d8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,7 +126,7 @@ if (NOT WIN32 AND NOT APPLE) set_target_properties(PrusaSlicer PROPERTIES OUTPUT_NAME "prusa-slicer") endif () -target_link_libraries(PrusaSlicer libslic3r cereal::cereal) +target_link_libraries(PrusaSlicer libslic3r libcereal) if (APPLE) # add_compile_options(-stdlib=libc++) # add_definitions(-DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_NO_CXX11_RVALUE_REFERENCES -DBOOST_THREAD_USES_MOVE) diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 36344ebab..5e8d681f1 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -358,7 +358,7 @@ find_package(JPEG REQUIRED) target_link_libraries(libslic3r libnest2d admesh - cereal::cereal + libcereal libigl miniz boost_libs diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index b23db9867..022bba2a8 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -270,7 +270,7 @@ endforeach() encoding_check(libslic3r_gui) -target_link_libraries(libslic3r_gui libslic3r avrdude cereal::cereal imgui GLEW::GLEW OpenGL::GL hidapi libcurl ${wxWidgets_LIBRARIES}) +target_link_libraries(libslic3r_gui libslic3r avrdude libcereal imgui GLEW::GLEW OpenGL::GL hidapi libcurl ${wxWidgets_LIBRARIES}) if (MSVC) target_link_libraries(libslic3r_gui Setupapi.lib)