CMakeLists.txt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # TODO Add individual tests as executables in separate directories
  2. # add_subirectory(<testcase>)
  3. set(TEST_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
  4. file(TO_NATIVE_PATH "${TEST_DATA_DIR}" TEST_DATA_DIR)
  5. add_library(Catch2 INTERFACE)
  6. list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/Catch2)
  7. target_include_directories(Catch2 INTERFACE ${CMAKE_CURRENT_LIST_DIR})
  8. add_library(Catch2::Catch2 ALIAS Catch2)
  9. if (APPLE)
  10. # OSX builds targeting OSX 10.9 do not support new std::uncought_exception()
  11. # see https://github.com/catchorg/Catch2/issues/1218
  12. target_compile_definitions(Catch2 INTERFACE -DCATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS)
  13. endif()
  14. include(Catch)
  15. set(CATCH_EXTRA_ARGS "" CACHE STRING "Extra arguments for catch2 test suites.")
  16. add_library(test_common INTERFACE)
  17. target_compile_definitions(test_common INTERFACE TEST_DATA_DIR=R"\(${TEST_DATA_DIR}\)" CATCH_CONFIG_FAST_COMPILE)
  18. target_link_libraries(test_common INTERFACE Catch2::Catch2)
  19. if (APPLE)
  20. target_link_libraries(test_common INTERFACE "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
  21. endif()
  22. set_property(GLOBAL PROPERTY USE_FOLDERS ON)
  23. add_subdirectory(libnest2d)
  24. add_subdirectory(libslic3r)
  25. add_subdirectory(slic3rutils)
  26. add_subdirectory(fff_print)
  27. add_subdirectory(sla_print)
  28. add_subdirectory(cpp17 EXCLUDE_FROM_ALL) # does not have to be built all the time
  29. # add_subdirectory(example)