1- cmake_minimum_required (VERSION 3.15 ...3.23 )
1+ cmake_minimum_required (VERSION 3.21 ...3.27 )
22
33project (CmakeConfigPackageTests LANGUAGES CXX)
44
@@ -19,15 +19,17 @@ endif()
1919
2020include (${Catch2_SOURCE_DIR} /extras/Catch.cmake)
2121
22- # Provide a simple smoke test to make sure that the CLI works and can display a --help message
23- add_test (NAME cli.has_help COMMAND intro --help)
22+ if (TARGET intro)
23+ # Provide a simple smoke test to make sure that the CLI works and can display a --help message
24+ add_test (NAME cli.has_help COMMAND intro --help)
2425
25- # Provide a test to verify that the version being reported from the application
26- # matches the version given to CMake. This will be important once you package
27- # your program. Real world shows that this is the kind of simple mistake that is easy
28- # to make, but also easy to test for.
29- add_test (NAME cli.version_matches COMMAND intro --version )
30- set_tests_properties (cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION} " )
26+ # Provide a test to verify that the version being reported from the application
27+ # matches the version given to CMake. This will be important once you package
28+ # your program. Real world shows that this is the kind of simple mistake that is easy
29+ # to make, but also easy to test for.
30+ add_test (NAME cli.version_matches COMMAND intro --version )
31+ set_tests_properties (cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION} " )
32+ endif ()
3133
3234add_executable (tests tests.cpp)
3335target_link_libraries (
0 commit comments