CMakeLists.txt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. set(COMMON_DATA_UTILS
  17. ${CMAKE_CURRENT_SOURCE_DIR}/data/cpp/test_data.cpp
  18. )
  19. add_library(test_common INTERFACE)
  20. target_compile_definitions(test_common INTERFACE TEST_DATA_DIR=R"\(${TEST_DATA_DIR}\)" CATCH_CONFIG_FAST_COMPILE)
  21. target_link_libraries(test_common INTERFACE Catch2::Catch2)
  22. add_library(test_common_data ${COMMON_DATA_UTILS})
  23. target_include_directories(test_common_data PUBLIC ${TEST_DATA_DIR}/include)
  24. target_link_libraries(test_common_data PRIVATE test_common libslic3r)
  25. if (APPLE)
  26. target_link_libraries(test_common INTERFACE "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
  27. endif()
  28. set_property(GLOBAL PROPERTY USE_FOLDERS ON)
  29. add_subdirectory(libnest2d)
  30. add_subdirectory(libslic3r)
  31. add_subdirectory(superslicerlibslic3r)
  32. add_subdirectory(slic3rutils)
  33. add_subdirectory(fff_print)
  34. add_subdirectory(sla_print)
  35. add_subdirectory(cpp17 EXCLUDE_FROM_ALL) # does not have to be built all the time
  36. # add_subdirectory(example)