diff --git a/CMakeLists.txt b/CMakeLists.txt index dc7a11a..e905de2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.15) project(testFFT) +file(GLOB test CONFIGURE_DEPENDS "test/*.cpp") + find_package(Catch2 REQUIRED) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -8,6 +10,7 @@ if ( CMAKE_COMPILER_IS_GNUCC ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") endif() -add_executable(${PROJECT_NAME} test/testFFT.cpp test/testIIR.cpp) +add_executable(${PROJECT_NAME} ${test}) +add_compile_definitions(CATCH_CONFIG_MAIN) include_directories(include) target_link_libraries(${PROJECT_NAME} Catch2::Catch2WithMain) diff --git a/test/testFFT.cpp b/test/testFFT.cpp index 6aadfb4..2081765 100644 --- a/test/testFFT.cpp +++ b/test/testFFT.cpp @@ -1,5 +1,4 @@ -#define CATCH_CONFIG_MAIN #include "catch2/catch_all.hpp" #include "sdsp/fft.h"