find_package(Catch2 REQUIRED) find_package(Eigen3) include(CTest) include(Catch) add_library(catch_main STATIC catch_main.cpp) target_link_libraries(catch_main PUBLIC Catch2::Catch2) target_link_libraries(catch_main PRIVATE project_options) set(TEST_FILES test_LiveAgg.cpp test_Rod2d.cpp test_Compute.cpp test_Simulation.cpp test_Integratoren.cpp) add_executable(tests ${TEST_FILES}) target_link_libraries(tests PRIVATE project_warnings project_options catch_main Eigen3::Eigen3 integratoren) # automatically discover tests that are defined in catch based test files you can modify the unittests. Set TEST_PREFIX # to whatever you want, or use different for different binaries catch_discover_tests( tests TEST_PREFIX "unittests." REPORTER xml OUTPUT_DIR . OUTPUT_PREFIX "unittests." OUTPUT_SUFFIX .xml)