diff --git a/CMakeLists.txt b/CMakeLists.txt index b9df8ff..bcb47aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,7 @@ endif() # Compile tests if(WITH_TESTS) configure_file("tests/test.gif" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY) - include(tests.CMakeLists.txt) + add_subdirectory(tests) endif() # Install library and header files diff --git a/tests.CMakeLists.txt b/tests/CMakeLists.txt similarity index 86% rename from tests.CMakeLists.txt rename to tests/CMakeLists.txt index a9338e1..4d0158a 100644 --- a/tests.CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,10 +1,10 @@ include(CTest) -file(GLOB sources_tests tests/test_*.cpp tests/*/test_*.cpp) +file(GLOB sources_tests test_*.cpp */test_*.cpp) find_package(Catch2) if(Catch2_FOUND) # Catch 2.x include(Catch) - add_executable(all_tests tests/main.cpp ${sources_tests}) + add_executable(all_tests main.cpp ${sources_tests}) target_link_libraries(all_tests ${PROJECT_NAME} Catch2::Catch2) target_include_directories(all_tests PRIVATE "/usr/include/catch2") catch_discover_tests(all_tests EXTRA_ARGS "${EXTRA_TEST_ARGS}")