13 lines
393 B
Plaintext
13 lines
393 B
Plaintext
if(WITH_TESTS)
|
|
find_package(Catch2 REQUIRED)
|
|
include(CTest)
|
|
|
|
file(GLOB sources_tests src/tests/test_*.cpp)
|
|
foreach(src ${sources_tests})
|
|
get_filename_component(bin ${src} NAME_WE)
|
|
add_executable(${bin} src/tests/main.cpp ${src})
|
|
target_link_libraries(${bin} ${CMAKE_PROJECT_NAME} Catch2::Catch2)
|
|
add_test(${bin} ${bin})
|
|
endforeach()
|
|
endif()
|