kazbek/tests/CMakeLists.txt

16 lines
532 B
CMake

find_package(Boost CONFIG COMPONENTS unit_test_framework REQUIRED)
file(GLOB KATJA_TEST_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
foreach(test_source ${KATJA_TEST_SOURCES})
get_filename_component(test_name ${test_source} NAME_WE)
set(tester ${test_name}-tester)
add_executable(${tester} ${test_source})
target_compile_definitions(${tester} PRIVATE "BOOST_TEST_DYN_LINK=1")
target_link_libraries(${tester} LINK_PRIVATE katja Boost::unit_test_framework)
add_test(NAME ${test_name} COMMAND ${tester})
endforeach()