@@ -33,10 +33,6 @@ find_package(Catch2 CONFIG REQUIRED)
3333
3434include (Catch)
3535
36- add_library (catch_main OBJECT catch_main.cpp)
37- target_link_libraries (catch_main PUBLIC Catch2::Catch2)
38- target_link_libraries (catch_main PRIVATE myproject::project_options)
39-
4036# Provide a simple smoke test to make sure that the CLI works and can display a --help message
4137add_test (NAME cli.has_help COMMAND intro --help)
4238
@@ -48,7 +44,7 @@ add_test(NAME cli.version_matches COMMAND intro --version)
4844set_tests_properties (cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION} " )
4945
5046add_executable (tests tests.cpp)
51- target_link_libraries (tests PRIVATE myproject::project_warnings myproject::project_options catch_main )
47+ target_link_libraries (tests PRIVATE myproject::project_warnings myproject::project_options Catch2::Catch2WithMain )
5248
5349# automatically discover tests that are defined in catch based test files you can modify the unittests. Set TEST_PREFIX
5450# to whatever you want, or use different for different binaries
@@ -57,7 +53,7 @@ catch_discover_tests(
5753 TEST_PREFIX
5854 "unittests."
5955 REPORTER
60- xml
56+ XML
6157 OUTPUT_DIR
6258 .
6359 OUTPUT_PREFIX
@@ -67,14 +63,14 @@ catch_discover_tests(
6763
6864# Add a file containing a set of constexpr tests
6965add_executable (constexpr_tests constexpr_tests.cpp)
70- target_link_libraries (constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main )
66+ target_link_libraries (constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain )
7167
7268catch_discover_tests(
7369 constexpr_tests
7470 TEST_PREFIX
7571 "constexpr."
7672 REPORTER
77- xml
73+ XML
7874 OUTPUT_DIR
7975 .
8076 OUTPUT_PREFIX
@@ -85,15 +81,15 @@ catch_discover_tests(
8581# Disable the constexpr portion of the test, and build again this allows us to have an executable that we can debug when
8682# things go wrong with the constexpr testing
8783add_executable (relaxed_constexpr_tests constexpr_tests.cpp)
88- target_link_libraries (relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main )
84+ target_link_libraries (relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain )
8985target_compile_definitions (relaxed_constexpr_tests PRIVATE -DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
9086
9187catch_discover_tests(
9288 relaxed_constexpr_tests
9389 TEST_PREFIX
9490 "relaxed_constexpr."
9591 REPORTER
96- xml
92+ XML
9793 OUTPUT_DIR
9894 .
9995 OUTPUT_PREFIX
0 commit comments