diff --git a/CMakeLists.txt b/CMakeLists.txt index 16af5a7e2..e519c36a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,7 @@ 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) @@ -20,7 +19,7 @@ option(OLDER_APPLE_CLANG "Apple Clang <= 13 used" OFF) option(ENABLE_THREADING "Enable threading support" ON) if (${ENABLE_ARCUS} OR ${ENABLE_PLUGINS}) - find_package(protobuf REQUIRED) + find_package(Protobuf REQUIRED) endif () MESSAGE(STATUS "Building with plugins support: ${ENABLE_PLUGINS}") @@ -34,7 +33,7 @@ endif () message(STATUS "Building with Arcus: ${ENABLE_ARCUS}") if (${ENABLE_ARCUS}) - find_package(arcus REQUIRED) + find_package(Arcus REQUIRED) protobuf_generate_cpp(engine_PB_SRCS engine_PB_HEADERS Cura.proto) endif () @@ -187,9 +186,7 @@ set(engine_SRCS # Except main.cpp. ) add_library(_CuraEngine STATIC ${engine_SRCS} ${engine_PB_SRCS}) -if (ENABLE_THREADING) - use_threads(_CuraEngine) -endif () +target_compile_features(_CuraEngine PUBLIC cxx_std_20) target_include_directories(_CuraEngine PUBLIC @@ -215,20 +212,13 @@ target_compile_definitions(_CuraEngine $<$:DEBUG> ) -enable_sanitizers(_CuraEngine) - -if (${EXTENSIVE_WARNINGS}) - set_project_warnings(_CuraEngine) -endif () - if (ENABLE_ARCUS) - target_link_libraries(_CuraEngine PUBLIC arcus::arcus) + target_link_libraries(_CuraEngine PUBLIC Arcus) endif () find_package(mapbox-wagyu REQUIRED) -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) @@ -252,14 +242,12 @@ target_link_libraries(_CuraEngine spdlog::spdlog range-v3::range-v3 fmt::fmt - clipper::clipper + Clipper::Clipper mapbox-wagyu::mapbox-wagyu - rapidjson - stb::stb - boost::boost + Boost::boost scripta::scripta PNG::PNG - $<$>:onetbb::onetbb> + $<$>:TBB::tbb> $<$:semver::semver> $<$:curaengine_grpc_definitions::curaengine_grpc_definitions> $<$:asio-grpc::asio-grpc> @@ -291,10 +279,6 @@ else () endif () endif (NOT WIN32) -if (ENABLE_THREADING) - use_threads(CuraEngine) -endif () - if (EMSCRIPTEN) message(STATUS "Building for Emscripten") target_link_options(_CuraEngine @@ -357,7 +341,7 @@ if (ENABLE_TESTING OR ENABLE_BENCHMARKS) $<$:grpc::grpc> $<$:protobuf::libprotobuf>) if (ENABLE_ARCUS) - target_link_libraries(test_helpers PUBLIC arcus::arcus) + target_link_libraries(test_helpers PUBLIC Arcus) endif () endif () @@ -372,3 +356,5 @@ if (ENABLE_TESTING) enable_testing() add_subdirectory(tests) endif () + +install(TARGETS CuraEngine DESTINATION ${CMAKE_INSTALL_BINDIR})