BD_Integratoren/C++/test/CMakeLists.txt
2022-05-16 10:24:45 +02:00

36 lines
884 B
CMake
Executable File

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 logging)
target_link_libraries(catch_main PRIVATE project_options)
set(TEST_FILES
test_ForceMulti.cpp
test_Simulation.cpp
test_LiveAgg.cpp
test_Rod2d.cpp
test_Rod2d_multi.cpp
test_Compute.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)