1- cmake_minimum_required (VERSION 3.8)
2- project (iris_tests CXX)
1+ cmake_minimum_required (VERSION 3.12)
2+ project (StrTplTests
3+ LANGUAGES CXX
4+ )
35include (CTest)
46
7+ # Import the globally installed StrTpl ifCMake has been started independently in
8+ # this directory with tests
9+ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
10+ find_package (StrTpl REQUIRED)
11+ endif ()
12+
513# This interface adds compile options to how the tests are run
6- add_library (iris_tests_config INTERFACE )
7- target_compile_options (iris_tests_config INTERFACE
14+ add_library (StrTplTestsConfig INTERFACE )
15+ target_compile_features (StrTplTestsConfig INTERFACE cxx_std_20)
16+ set_target_properties (StrTplTestsConfig PROPERTIES
17+ CXX_STANDARD_REQUIRED ON
18+ CXX_EXTENSIONS OFF
19+ )
20+ target_compile_options (StrTplTestsConfig INTERFACE
821 -fno-strict-aliasing
922 -Wall
1023 -Wcast-align
@@ -31,12 +44,12 @@ target_compile_options(iris_tests_config INTERFACE
3144 >
3245 # $<$<CXX_COMPILER_ID:Clang>:
3346 # $<$<AND:$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.99>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,6>>:
34- # $<$<EQUAL:${IRIS_CXX_STANDARD },17>:-Wno-undefined-func-template>
47+ # $<$<EQUAL:${STRTPL_CXX_STANDARD },17>:-Wno-undefined-func-template>
3548 # >
3649 # >
3750 # $<$<CXX_COMPILER_ID:AppleClang>:
3851 # $<$<AND:$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,9.1>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,10>>:
39- # $<$<EQUAL:${IRIS_CXX_STANDARD },17>:-Wno-undefined-func-template>
52+ # $<$<EQUAL:${STRTPL_CXX_STANDARD },17>:-Wno-undefined-func-template>
4053 # >
4154 # >
4255 $<$<CXX_COMPILER_ID:GNU>:
@@ -53,21 +66,12 @@ target_compile_options(iris_tests_config INTERFACE
5366 >
5467)
5568
56- # Import the globally installed iris if CMake has been started independently in
57- # this directory with tests
58- if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR )
59- find_package (iris::iris REQUIRED)
60- endif ()
61-
62- # Use Catch2 as a unit testing framework
63- # find_package(Catch2)
64-
6569Include (FetchContent)
6670FetchContent_Declare(Catch2
6771 GIT_REPOSITORY https://github.com/catchorg/Catch2.git
68- GIT_TAG v2.13.6 )
72+ GIT_TAG v3.0.1 )
6973FetchContent_MakeAvailable(Catch2)
7074
71- add_subdirectory (main)
7275add_subdirectory (regex )
76+ add_subdirectory (string_template)
7377add_subdirectory (trailing_view)
0 commit comments