diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 14493bd4..04acdaab 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -96,22 +96,21 @@ foreach(file ${files}) string(REGEX REPLACE "unit-([^$]+)" "test-\\1" testcase ${file_basename}) add_executable(${testcase} $ ${file}) - set_target_properties(${testcase} PROPERTIES - COMPILE_DEFINITIONS "$<$:_SCL_SECURE_NO_WARNINGS>" - COMPILE_OPTIONS "$<$:/EHsc;$<$:/Od>>" + target_compile_definitions(${testcase} PRIVATE + CATCH_CONFIG_FAST_COMPILE + $<$:_SCL_SECURE_NO_WARNINGS> + ) + target_compile_options(${testcase} PRIVATE + $<$:/EHsc;$<$:/Od>> + $<$>:-Wno-deprecated;-Wno-float-equal> + $<$:-Wno-deprecated-declarations> + ) + target_include_directories(${testcase} PRIVATE + thirdparty/catch + thirdparty/fifo_map ) - - target_compile_definitions(${testcase} PRIVATE CATCH_CONFIG_FAST_COMPILE) - target_compile_features(${testcase} PRIVATE cxx_std_11) - target_include_directories(${testcase} PRIVATE "thirdparty/catch") - target_include_directories(${testcase} PRIVATE "thirdparty/fifo_map") - target_include_directories(${testcase} PRIVATE ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}) target_link_libraries(${testcase} ${NLOHMANN_JSON_TARGET_NAME}) - if(NOT MSVC) - set_target_properties(${testcase} PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-float-equal") - endif() - add_test(NAME "${testcase}_default" COMMAND ${testcase} ${CATCH_TEST_FILTER} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} @@ -131,7 +130,6 @@ foreach(file ${files}) ) set_tests_properties("${testcase}_valgrind" PROPERTIES LABELS "valgrind") endif() - endforeach() #############################################################################