From 2907001e2258861d166e9fe9d9f8c660a2a0271d Mon Sep 17 00:00:00 2001 From: "Kevin M. Godby" Date: Wed, 4 May 2016 19:53:22 -0500 Subject: [PATCH] Fixed Catch tests. --- tests/CMakeLists.txt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 722a7195..307ddeb6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -5,16 +5,14 @@ enable_testing() # Build Catch unit tests -#function(add_catch_test _testname) -# add_executable(${_testname} ${_testname}.cpp) -# target_link_libraries(${_testname} Catch) -# add_test(NAME test_${_testname} COMMAND ${_testname}) -#endfunction() -# -#file(GLOB catch_tests LIST_DIRECTORIES false *.cpp) -#foreach(catch_test IN LIST catch_tests) -# add_catch_test(${catch_test}) -#endforeach() +add_library(catch INTERFACE) +target_include_directories(catch INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +file(GLOB catch_tests LIST_DIRECTORIES false RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) +add_executable(catch_tests ${catch_tests}) +target_link_libraries(catch_tests spdlog) +add_test(NAME catch_tests COMMAND catch_tests) +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/logs") # Ensure headers include their own dependencies add_subdirectory(header_dependencies)