24 lines
898 B
CMake
24 lines
898 B
CMake
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
|
|
|
|
project(UnitTest CXX)
|
|
|
|
include(../external/catch2/contrib/Catch.cmake)
|
|
|
|
add_executable(UnitTest adummy.cpp characteristics_tests.cpp)
|
|
|
|
set_target_properties(Catch2 UnitTest PROPERTIES
|
|
CXX_STANDARD 17
|
|
CXX_STANDARD_REQUIRED ON
|
|
CXX_EXTENSIONS OFF
|
|
INTERPROCEDURAL_OPTIMIZATION ON
|
|
# UNITY_BUILD ON
|
|
)
|
|
target_include_directories(UnitTest PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
|
target_compile_definitions(UnitTest PRIVATE ${DEF_COMP})
|
|
target_compile_options(UnitTest PRIVATE ${COMPILE_FLAGS})
|
|
target_link_options(UnitTest PRIVATE ${LINKER_OPTIONS})
|
|
target_link_libraries(UnitTest ${LINKER_FLAGS} Catch2 nlohmann_json::nlohmann_json)
|
|
|
|
enable_testing()
|
|
catch_discover_tests(UnitTest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} REPORTER junit OUTPUT_DIR ${CMAKE_SOURCE_DIR} OUTPUT_PREFIX cppspec- OUTPUT_SUFFIX .xml)
|