CMakeLists.txt 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # TODO Add individual tests as executables in separate directories
  2. # add_subirectory(<testcase>)
  3. find_package(Catch2 2.9 REQUIRED)
  4. include(Catch)
  5. set(TEST_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
  6. file(TO_NATIVE_PATH "${TEST_DATA_DIR}" TEST_DATA_DIR)
  7. set(CATCH_EXTRA_ARGS "" CACHE STRING "Extra arguments for catch2 test suites.")
  8. set(COMMON_DATA_UTILS
  9. ${CMAKE_CURRENT_SOURCE_DIR}/data/cpp/test_data.cpp
  10. )
  11. add_library(test_common INTERFACE)
  12. target_include_directories(test_common INTERFACE ${CMAKE_CURRENT_LIST_DIR})
  13. target_compile_definitions(test_common INTERFACE TEST_DATA_DIR=R"\(${TEST_DATA_DIR}\)" CATCH_CONFIG_FAST_COMPILE)
  14. target_link_libraries(test_common INTERFACE Catch2::Catch2)
  15. add_library(test_common_data ${COMMON_DATA_UTILS})
  16. target_include_directories(test_common_data PUBLIC ${TEST_DATA_DIR}/include)
  17. target_link_libraries(test_common_data PRIVATE test_common libslic3r)
  18. if (APPLE)
  19. target_link_libraries(test_common INTERFACE "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
  20. endif()
  21. set_property(GLOBAL PROPERTY USE_FOLDERS ON)
  22. add_subdirectory(arrange)
  23. add_subdirectory(thumbnails)
  24. add_subdirectory(libslic3r)
  25. add_subdirectory(superslicerlibslic3r)
  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. if (SLIC3R_GUI)
  30. add_subdirectory(slic3rutils)
  31. endif()
  32. # add_subdirectory(example)