@@ -12,34 +12,32 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS
1212)
1313
1414option (BUILD_TESTING "If ON, unit tests will be built." ON )
15- option (BUILD_GLOBAL_TESTING "If ON, the global unit test will be built." ON )
16-
17- find_package (Catch2 3.8.0 REQUIRED)
18- if (Catch2_FOUND)
19- message (STATUS "Found Catch2 ${Catch2_VERSION} ." )
20- else ()
21- message (FATAL_ERROR "Could not find libraries for Catch2." )
22- endif ()
2315
2416# Import CMake helper functions
2517list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} /CMake)
26- include (ystdlib-cpp-helpers)
2718
2819if (BUILD_TESTING)
29- # Set up the global unit test target
30- if (BUILD_GLOBAL_TESTING)
31- set (GLOBAL_UNIT_TEST_TARGET "unit-test-all" )
32- add_executable (${GLOBAL_UNIT_TEST_TARGET} )
33- target_link_libraries (${GLOBAL_UNIT_TEST_TARGET} PRIVATE Catch2::Catch2WithMain)
34- target_compile_features (${GLOBAL_UNIT_TEST_TARGET} PRIVATE cxx_std_20)
35- set_property (
36- TARGET
37- ${GLOBAL_UNIT_TEST_TARGET}
38- PROPERTY
39- RUNTIME_OUTPUT_DIRECTORY
40- ${CMAKE_BINARY_DIR} /testbin
41- )
20+ find_package (Catch2 3.8.0 REQUIRED)
21+ if (Catch2_FOUND)
22+ message (STATUS "Found Catch2 ${Catch2_VERSION} ." )
23+ else ()
24+ message (FATAL_ERROR "Could not find libraries for Catch2." )
4225 endif ()
26+
27+ # Set up the unified unit test target
28+ set (UNIFIED_UNIT_TEST_TARGET "unit-test-all" )
29+ add_executable (${UNIFIED_UNIT_TEST_TARGET} )
30+ target_link_libraries (${UNIFIED_UNIT_TEST_TARGET} PRIVATE Catch2::Catch2WithMain)
31+ target_compile_features (${UNIFIED_UNIT_TEST_TARGET} PRIVATE cxx_std_20)
32+ set_property (
33+ TARGET
34+ ${UNIFIED_UNIT_TEST_TARGET}
35+ PROPERTY
36+ RUNTIME_OUTPUT_DIRECTORY
37+ ${CMAKE_BINARY_DIR} /testbin
38+ )
4339endif ()
4440
41+ include (ystdlib-cpp-helpers)
42+
4543add_subdirectory (src/ystdlib)
0 commit comments