--- ./CMakeLists.txt.orig +++ ./CMakeLists.txt @@ -4,9 +4,9 @@ cmake_policy(SET CMP0091 NEW) # For MSVC flags, will be ignored on non-Windows OS's cmake_minimum_required(VERSION 3.20) project(CuraEngine) -find_package(standardprojectsettings REQUIRED) # imports the cmake module https://github.com/Ultimaker/conan-ultimaker-index/recipes/standardprojectsettings -AssureOutOfSourceBuilds() +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + option(ENABLE_ARCUS "Enable support for ARCUS" ON) option(ENABLE_TESTING "Build with unit tests" OFF) option(EXTENSIVE_WARNINGS "Build with all warnings" ON) @@ -21,8 +21,8 @@ if (ENABLE_ARCUS) message(STATUS "Building with Arcus") - find_package(arcus REQUIRED) - find_package(protobuf REQUIRED) + find_package(Arcus REQUIRED) + find_package(Protobuf REQUIRED) protobuf_generate_cpp(engine_PB_SRCS engine_PB_HEADERS Cura.proto) endif () @@ -139,8 +139,9 @@ src/utils/VoronoiUtils.cpp ) +add_compile_options(-std=c++20) + add_library(_CuraEngine STATIC ${engine_SRCS} ${engine_PB_SRCS}) -use_threads(_CuraEngine) target_include_directories(_CuraEngine PUBLIC @@ -164,24 +165,17 @@ $<$:DEBUG> ) -enable_sanitizers(_CuraEngine) - -if (${EXTENSIVE_WARNINGS}) - set_project_warnings(_CuraEngine) -endif () - if (ENABLE_OPENMP) find_package(OpenMP REQUIRED) target_link_libraries(_CuraEngine PUBLIC OpenMP::OpenMP_CXX) endif () if (ENABLE_ARCUS) - target_link_libraries(_CuraEngine PRIVATE arcus::arcus protobuf::libprotobuf) + target_link_libraries(_CuraEngine PRIVATE Arcus protobuf::libprotobuf) endif () -find_package(clipper REQUIRED) +find_package(Clipper REQUIRED) find_package(RapidJSON REQUIRED) -find_package(stb REQUIRED) find_package(Boost REQUIRED) find_package(spdlog REQUIRED) find_package(fmt REQUIRED) @@ -197,10 +191,8 @@ PRIVATE range-v3::range-v3 fmt::fmt - clipper::clipper - rapidjson - stb::stb - boost::boost + Clipper::Clipper + Boost::boost $<$:GTest::gtest>) if (NOT WIN32) @@ -227,3 +219,5 @@ enable_testing() add_subdirectory(tests) endif () + +install(TARGETS CuraEngine DESTINATION "${CMAKE_INSTALL_BINDIR}")