@@ -21,10 +21,6 @@ find_package(Catch2 CONFIG REQUIRED)
2121
2222include (Catch)
2323
24- add_library (catch_main OBJECT catch_main.cpp)
25- target_link_libraries (catch_main PUBLIC Catch2::Catch2)
26- target_link_libraries (catch_main PRIVATE myproject::project_options)
27-
2824# Provide a simple smoke test to make sure that the CLI works and can display a --help message
2925add_test (NAME cli.has_help COMMAND intro --help)
3026
@@ -36,7 +32,7 @@ add_test(NAME cli.version_matches COMMAND intro --version)
3632set_tests_properties (cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION} " )
3733
3834add_executable (tests tests.cpp)
39- target_link_libraries (tests PRIVATE myproject::project_warnings myproject::project_options catch_main )
35+ target_link_libraries (tests PRIVATE myproject::project_warnings myproject::project_options Catch2::Catch2WithMain )
4036
4137# automatically discover tests that are defined in catch based test files you can modify the unittests. Set TEST_PREFIX
4238# to whatever you want, or use different for different binaries
@@ -45,7 +41,7 @@ catch_discover_tests(
4541 TEST_PREFIX
4642 "unittests."
4743 REPORTER
48- xml
44+ XML
4945 OUTPUT_DIR
5046 .
5147 OUTPUT_PREFIX
@@ -55,14 +51,14 @@ catch_discover_tests(
5551
5652# Add a file containing a set of constexpr tests
5753add_executable (constexpr_tests constexpr_tests.cpp)
58- target_link_libraries (constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main )
54+ target_link_libraries (constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain )
5955
6056catch_discover_tests(
6157 constexpr_tests
6258 TEST_PREFIX
6359 "constexpr."
6460 REPORTER
65- xml
61+ XML
6662 OUTPUT_DIR
6763 .
6864 OUTPUT_PREFIX
@@ -73,15 +69,15 @@ catch_discover_tests(
7369# Disable the constexpr portion of the test, and build again this allows us to have an executable that we can debug when
7470# things go wrong with the constexpr testing
7571add_executable (relaxed_constexpr_tests constexpr_tests.cpp)
76- target_link_libraries (relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main )
72+ target_link_libraries (relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain )
7773target_compile_definitions (relaxed_constexpr_tests PRIVATE -DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
7874
7975catch_discover_tests(
8076 relaxed_constexpr_tests
8177 TEST_PREFIX
8278 "relaxed_constexpr."
8379 REPORTER
84- xml
80+ XML
8581 OUTPUT_DIR
8682 .
8783 OUTPUT_PREFIX
0 commit comments