2022-02-07 00:05:11 +01:00
|
|
|
include(CatchMiscFunctions)
|
2019-11-30 17:41:41 +01:00
|
|
|
|
2022-03-18 00:21:12 +01:00
|
|
|
# CMake derives a Visual Studio project GUID from the file path but can be overridden via a property
|
|
|
|
# (see https://gitlab.kitware.com/cmake/cmake/-/commit/c85367f4). Using a non-constant GUID
|
|
|
|
# can cause problems if other projects/repos want to reference the vcxproj file,
|
|
|
|
# so we force a constant GUID here.
|
|
|
|
set(Catch2_GUID_CMAKE "8d538cbe-01bf-4a2e-a98a-6c368fdf13d7" CACHE INTERNAL "Project GUID")
|
|
|
|
set(Catch2WithMain_GUID_CMAKE "8bd3552a-2cfb-4a59-ab15-2031b97ada1e" CACHE INTERNAL "Project GUID")
|
|
|
|
|
2019-11-30 17:41:41 +01:00
|
|
|
# Please keep these ordered alphabetically
|
|
|
|
set(BENCHMARK_HEADERS
|
|
|
|
${SOURCES_DIR}/benchmark/catch_benchmark.hpp
|
2020-05-05 21:07:16 +02:00
|
|
|
${SOURCES_DIR}/benchmark/catch_benchmark_all.hpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/benchmark/catch_chronometer.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/catch_clock.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/catch_constructor.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/catch_environment.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/catch_estimate.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/catch_execution_plan.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/catch_optimizer.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/catch_outlier_classification.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/catch_sample_analysis.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_analyse.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_benchmark_function.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_complete_invoke.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_estimate_clock.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_measure.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_repeat.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_run_for_at_least.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_stats.hpp
|
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_timing.hpp
|
|
|
|
)
|
|
|
|
set(BENCHMARK_SOURCES
|
2020-05-10 10:20:48 +02:00
|
|
|
${SOURCES_DIR}/benchmark/internal/catch_benchmark_combined_tu.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/benchmark/detail/catch_stats.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
SOURCE_GROUP("benchmark" FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES})
|
|
|
|
|
|
|
|
set(INTERNAL_HEADERS
|
2022-02-02 15:36:58 +01:00
|
|
|
"${CMAKE_BINARY_DIR}/generated-includes/catch2/catch_user_config.hpp"
|
|
|
|
"${SOURCES_DIR}/catch_user_config.hpp.in"
|
2020-05-05 21:07:16 +02:00
|
|
|
${SOURCES_DIR}/catch_all.hpp
|
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_all.hpp
|
|
|
|
${SOURCES_DIR}/generators/catch_generators_all.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_all.hpp
|
2020-04-26 21:33:55 +02:00
|
|
|
${SOURCES_DIR}/matchers/internal/catch_matchers_impl.hpp
|
2021-12-26 00:27:11 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_case_insensitive_comparisons.hpp
|
2020-08-01 19:09:18 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_console_width.hpp
|
2020-03-09 11:13:07 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_container_nonmembers.hpp
|
2020-08-18 11:35:58 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_noncopyable.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/catch_approx.hpp
|
2020-05-10 18:24:53 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_assertion_handler.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/catch_assertion_info.hpp
|
|
|
|
${SOURCES_DIR}/catch_assertion_result.hpp
|
2020-04-26 13:32:17 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_test_macro_impl.hpp
|
2020-11-27 18:08:37 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_test_failure_exception.hpp
|
2020-08-18 13:11:30 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_case_sensitive.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_clara.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_commandline.hpp
|
2020-11-27 11:08:26 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_source_line_info.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_compiler_capabilities.hpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/catch_config.hpp
|
2020-12-28 11:21:04 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_config_android_logwrite.hpp
|
2020-12-29 11:07:45 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_config_counter.hpp
|
2020-10-06 11:07:53 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_config_uncaught_exceptions.hpp
|
2020-12-28 20:29:05 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_config_wchar.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_console_colour.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_context.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_debug_console.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_debugger.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_decomposer.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_enforce.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_enum_values_registry.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_errno_guard.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_exception_translator_registry.hpp
|
2020-04-25 14:07:50 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_fatal_condition_handler.hpp
|
2021-07-26 22:01:04 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_floating_point_helpers.hpp
|
2021-02-24 23:13:56 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_unique_name.hpp
|
2021-11-20 23:41:04 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_sharding.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/generators/catch_generator_exception.hpp
|
|
|
|
${SOURCES_DIR}/generators/catch_generators.hpp
|
|
|
|
${SOURCES_DIR}/generators/catch_generators_adapters.hpp
|
|
|
|
${SOURCES_DIR}/generators/catch_generators_random.hpp
|
|
|
|
${SOURCES_DIR}/generators/catch_generators_range.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_capture.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_config.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_enum_values_registry.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_exception.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_generatortracker.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_registry_hub.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_reporter.hpp
|
2020-08-23 21:19:26 +02:00
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.hpp
|
2020-08-23 18:16:10 +02:00
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_reporter_registry.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_tag_alias_registry.hpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_testcase.hpp
|
2020-05-10 19:19:42 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_lazy_expr.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_leak_detector.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_list.hpp
|
2020-03-01 19:59:18 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers.hpp
|
2020-03-09 11:13:07 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_container_properties.hpp
|
2020-03-02 14:25:43 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_contains.hpp
|
2020-02-20 13:57:24 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_exception.hpp
|
2020-12-13 15:41:12 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_floating_point.hpp
|
2020-03-18 15:57:11 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_predicate.hpp
|
2020-12-08 00:23:54 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_quantifiers.hpp
|
2020-03-01 19:59:18 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_string.hpp
|
2020-03-18 15:57:11 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_templated.hpp
|
2020-03-01 19:59:18 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_vector.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/catch_message.hpp
|
2020-05-10 16:44:27 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_message_info.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_meta.hpp
|
2021-08-13 00:11:22 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_move_and_forward.hpp
|
2021-10-05 20:11:42 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_optional.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_output_redirect.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_platform.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_polyfills.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_preprocessor.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_random_number_generator.hpp
|
2021-10-08 20:02:24 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_random_seed_generation.hpp
|
2021-11-10 23:52:59 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_registrars.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_reporter_registry.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_result_type.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_run_context.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_section.hpp
|
|
|
|
${SOURCES_DIR}/catch_section_info.hpp
|
|
|
|
${SOURCES_DIR}/catch_session.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_singletons.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_startup_exception_registry.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_stream.hpp
|
2020-11-27 10:43:07 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_stream_end_stop.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_string_manip.hpp
|
2020-05-10 10:09:01 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_stringref.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/catch_tag_alias.hpp
|
|
|
|
${SOURCES_DIR}/catch_tag_alias_autoregistrar.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_tag_alias_registry.hpp
|
|
|
|
${SOURCES_DIR}/catch_test_case_info.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_test_case_registry_impl.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_test_case_tracker.hpp
|
2020-04-26 16:25:43 +02:00
|
|
|
${SOURCES_DIR}/catch_template_test_macros.hpp
|
2020-01-19 16:01:50 +01:00
|
|
|
${SOURCES_DIR}/catch_test_macros.hpp
|
2020-04-26 16:25:43 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_template_test_registry.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_test_registry.hpp
|
|
|
|
${SOURCES_DIR}/catch_test_spec.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_test_spec_parser.hpp
|
2020-08-01 20:32:26 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_textflow.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/catch_timer.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_to_string.hpp
|
|
|
|
${SOURCES_DIR}/catch_tostring.hpp
|
|
|
|
${SOURCES_DIR}/catch_totals.hpp
|
2020-05-19 21:16:33 +02:00
|
|
|
${SOURCES_DIR}/catch_translate_exception.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_uncaught_exceptions.hpp
|
2020-05-24 23:41:02 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_unique_ptr.hpp
|
2021-10-27 19:49:46 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_void_type.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/catch_version.hpp
|
2020-01-19 15:30:38 +01:00
|
|
|
${SOURCES_DIR}/catch_version_macros.hpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_wildcard_pattern.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_windows_h_proxy.hpp
|
|
|
|
${SOURCES_DIR}/internal/catch_xmlwriter.hpp
|
2022-03-31 16:46:41 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_test_case_info_hasher.hpp
|
2019-11-30 17:41:41 +01:00
|
|
|
)
|
|
|
|
set(IMPL_SOURCES
|
|
|
|
${SOURCES_DIR}/catch_approx.cpp
|
2020-05-10 18:24:53 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_assertion_handler.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/catch_assertion_result.cpp
|
2020-05-10 10:20:48 +02:00
|
|
|
${SOURCES_DIR}/matchers/internal/catch_matchers_combined_tu.cpp
|
2020-08-08 18:18:27 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_clara.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_commandline.cpp
|
2020-11-27 11:08:26 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_source_line_info.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/catch_config.cpp
|
2021-12-26 00:27:11 +01:00
|
|
|
${SOURCES_DIR}/internal/catch_case_insensitive_comparisons.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_console_colour.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_context.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_debug_console.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_debugger.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_enforce.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_enum_values_registry.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_exception_translator_registry.cpp
|
2020-04-25 14:07:50 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_fatal_condition_handler.cpp
|
2021-07-26 22:01:04 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_floating_point_helpers.cpp
|
2020-05-10 10:20:48 +02:00
|
|
|
${SOURCES_DIR}/generators/internal/catch_generators_combined_tu.cpp
|
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_combined_tu.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/interfaces/catch_interfaces_reporter.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_list.cpp
|
2020-12-13 15:41:12 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_floating_point.cpp
|
2020-02-20 13:57:24 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_string.cpp
|
2020-03-18 15:57:11 +01:00
|
|
|
${SOURCES_DIR}/matchers/catch_matchers_templated.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/catch_message.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_output_redirect.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/catch_registry_hub.cpp
|
2020-05-10 10:20:48 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_combined_tu.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_random_number_generator.cpp
|
2021-10-08 20:02:24 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_random_seed_generation.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_reporter_registry.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_result_type.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_run_context.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_section.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/catch_session.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_singletons.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_stream.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_stringref.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_string_manip.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_tag_alias_registry.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/catch_test_case_info.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_test_case_registry_impl.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_test_case_tracker.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_test_registry.cpp
|
2020-08-01 20:32:26 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_textflow.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/catch_test_spec.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_test_spec_parser.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/catch_timer.cpp
|
|
|
|
${SOURCES_DIR}/catch_tostring.cpp
|
|
|
|
${SOURCES_DIR}/catch_totals.cpp
|
|
|
|
${SOURCES_DIR}/catch_version.cpp
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_wildcard_pattern.cpp
|
|
|
|
${SOURCES_DIR}/internal/catch_xmlwriter.cpp
|
2022-03-31 16:46:41 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_test_case_info_hasher.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
)
|
|
|
|
set(INTERNAL_FILES ${IMPL_SOURCES} ${INTERNAL_HEADERS})
|
|
|
|
|
|
|
|
# Please keep these ordered alphabetically
|
|
|
|
set(REPORTER_HEADERS
|
2020-05-05 21:07:16 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporters_all.hpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_automake.hpp
|
2022-03-06 16:08:31 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_common_base.hpp
|
2020-04-04 21:53:23 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_compact.hpp
|
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_console.hpp
|
2020-08-22 23:16:23 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_cumulative_base.hpp
|
2020-08-24 22:52:59 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_event_listener.hpp
|
2020-08-23 22:43:56 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_helpers.hpp
|
2020-04-04 21:53:23 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_junit.hpp
|
2022-01-04 21:48:20 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_multi.hpp
|
2019-12-08 11:31:47 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_sonarqube.hpp
|
2020-08-22 23:16:23 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_streaming_base.hpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_tap.hpp
|
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_teamcity.hpp
|
2020-04-04 21:53:23 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_xml.hpp
|
2019-11-30 17:41:41 +01:00
|
|
|
)
|
|
|
|
set(REPORTER_SOURCES
|
2019-12-08 11:31:47 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_automake.cpp
|
2020-08-23 22:43:56 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_combined_tu.cpp
|
2022-03-06 16:08:31 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_common_base.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_compact.cpp
|
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_console.cpp
|
2020-08-22 23:16:23 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_cumulative_base.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_junit.cpp
|
2022-01-04 21:48:20 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_multi.cpp
|
2019-12-08 11:31:47 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_sonarqube.cpp
|
2020-08-22 23:16:23 +02:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_streaming_base.cpp
|
2019-12-08 11:31:47 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_tap.cpp
|
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_teamcity.cpp
|
2019-11-30 17:41:41 +01:00
|
|
|
${SOURCES_DIR}/reporters/catch_reporter_xml.cpp
|
|
|
|
)
|
|
|
|
set(REPORTER_FILES ${REPORTER_HEADERS} ${REPORTER_SOURCES})
|
|
|
|
|
|
|
|
# Fixme: STATIC because for dynamic, we would need to handle visibility
|
|
|
|
# and I don't want to do the annotations right now
|
|
|
|
add_library(Catch2 STATIC
|
|
|
|
${REPORTER_FILES}
|
|
|
|
${INTERNAL_FILES}
|
|
|
|
${BENCHMARK_HEADERS}
|
|
|
|
${BENCHMARK_SOURCES}
|
|
|
|
)
|
2021-05-09 17:36:30 +02:00
|
|
|
add_build_reproducibility_settings(Catch2)
|
2020-05-11 20:05:10 +02:00
|
|
|
add_library(Catch2::Catch2 ALIAS Catch2)
|
2019-12-18 17:25:04 +01:00
|
|
|
|
2019-12-16 22:33:56 +01:00
|
|
|
if (ANDROID)
|
|
|
|
target_link_libraries(Catch2 INTERFACE log)
|
|
|
|
endif()
|
|
|
|
|
2021-08-28 00:47:54 +02:00
|
|
|
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "d")
|
|
|
|
|
2019-12-16 22:33:56 +01:00
|
|
|
# depend on bunch of C++11 and C++14 features to have C++14 enabled by default
|
|
|
|
target_compile_features(Catch2
|
2019-12-18 17:25:04 +01:00
|
|
|
PUBLIC
|
2019-12-16 22:33:56 +01:00
|
|
|
cxx_alignas
|
|
|
|
cxx_alignof
|
|
|
|
cxx_attributes
|
|
|
|
cxx_auto_type
|
|
|
|
cxx_constexpr
|
|
|
|
cxx_defaulted_functions
|
|
|
|
cxx_deleted_functions
|
|
|
|
cxx_final
|
|
|
|
cxx_lambdas
|
|
|
|
cxx_noexcept
|
|
|
|
cxx_override
|
|
|
|
cxx_range_for
|
|
|
|
cxx_rvalue_references
|
|
|
|
cxx_static_assert
|
|
|
|
cxx_strong_enums
|
|
|
|
cxx_trailing_return_types
|
|
|
|
cxx_unicode_literals
|
|
|
|
cxx_user_literals
|
|
|
|
cxx_variable_templates
|
|
|
|
cxx_variadic_macros
|
|
|
|
)
|
|
|
|
|
2022-02-02 15:36:58 +01:00
|
|
|
configure_file(
|
|
|
|
"${SOURCES_DIR}/catch_user_config.hpp.in"
|
|
|
|
"${CMAKE_BINARY_DIR}/generated-includes/catch2/catch_user_config.hpp"
|
|
|
|
)
|
|
|
|
|
2019-12-18 17:25:04 +01:00
|
|
|
target_include_directories(Catch2
|
|
|
|
PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
|
2022-02-02 15:36:58 +01:00
|
|
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated-includes>
|
2019-12-18 17:25:04 +01:00
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-05-03 18:54:38 +02:00
|
|
|
add_library(Catch2WithMain STATIC
|
2020-03-30 10:34:21 +02:00
|
|
|
${SOURCES_DIR}/internal/catch_main.cpp
|
2019-12-18 17:25:04 +01:00
|
|
|
)
|
2021-05-09 17:36:30 +02:00
|
|
|
add_build_reproducibility_settings(Catch2WithMain)
|
2020-05-03 18:54:38 +02:00
|
|
|
add_library(Catch2::Catch2WithMain ALIAS Catch2WithMain)
|
|
|
|
target_link_libraries(Catch2WithMain PUBLIC Catch2)
|
|
|
|
set_target_properties(Catch2WithMain
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "Catch2Main"
|
|
|
|
)
|
2021-08-28 00:47:54 +02:00
|
|
|
set_target_properties(Catch2WithMain PROPERTIES DEBUG_POSTFIX "d")
|
2019-12-18 17:25:04 +01:00
|
|
|
|
2019-12-16 22:33:56 +01:00
|
|
|
if (NOT_SUBPROJECT)
|
|
|
|
# create and install an export set for catch target as Catch2::Catch
|
|
|
|
install(
|
|
|
|
TARGETS
|
|
|
|
Catch2
|
2020-05-03 18:54:38 +02:00
|
|
|
Catch2WithMain
|
2019-12-16 22:33:56 +01:00
|
|
|
EXPORT
|
|
|
|
Catch2Targets
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_LIBDIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
install(
|
|
|
|
EXPORT
|
|
|
|
Catch2Targets
|
|
|
|
NAMESPACE
|
|
|
|
Catch2::
|
|
|
|
DESTINATION
|
|
|
|
${CATCH_CMAKE_CONFIG_DESTINATION}
|
|
|
|
)
|
2019-12-18 17:25:04 +01:00
|
|
|
# Install the headers
|
2022-02-02 15:36:58 +01:00
|
|
|
install(
|
|
|
|
DIRECTORY
|
|
|
|
"${SOURCES_DIR}"
|
|
|
|
"${CMAKE_BINARY_DIR}/generated-includes/catch2" # Also install the generated header
|
|
|
|
DESTINATION
|
|
|
|
"${CMAKE_INSTALL_INCLUDEDIR}"
|
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.hpp"
|
|
|
|
)
|
2019-12-16 22:33:56 +01:00
|
|
|
endif()
|
|
|
|
|
2019-12-15 20:33:39 +01:00
|
|
|
# Some tests require a full recompilation of Catch2 lib with different
|
|
|
|
# compilation flags. They can link against this target to recompile all
|
|
|
|
# the sources into the binary.
|
|
|
|
if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS)
|
|
|
|
add_library(Catch2_buildall_interface INTERFACE)
|
|
|
|
target_sources(Catch2_buildall_interface INTERFACE
|
2019-12-08 20:57:55 +01:00
|
|
|
${REPORTER_FILES}
|
|
|
|
${INTERNAL_FILES}
|
|
|
|
${BENCHMARK_HEADERS}
|
|
|
|
${BENCHMARK_SOURCES}
|
2020-05-07 16:24:05 +02:00
|
|
|
# Also include main entry point
|
|
|
|
${SOURCES_DIR}/internal/catch_main.cpp
|
2019-12-08 20:57:55 +01:00
|
|
|
)
|
2019-12-15 20:33:39 +01:00
|
|
|
target_include_directories(Catch2_buildall_interface
|
|
|
|
INTERFACE
|
2019-12-08 20:57:55 +01:00
|
|
|
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
|
2022-02-02 15:36:58 +01:00
|
|
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated-includes>
|
2019-12-08 20:57:55 +01:00
|
|
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
|
|
)
|
2020-02-21 21:15:45 +01:00
|
|
|
target_compile_features(Catch2_buildall_interface
|
|
|
|
INTERFACE
|
|
|
|
cxx_alignas
|
|
|
|
cxx_alignof
|
|
|
|
cxx_attributes
|
|
|
|
cxx_auto_type
|
|
|
|
cxx_constexpr
|
|
|
|
cxx_defaulted_functions
|
|
|
|
cxx_deleted_functions
|
|
|
|
cxx_final
|
|
|
|
cxx_lambdas
|
|
|
|
cxx_noexcept
|
|
|
|
cxx_override
|
|
|
|
cxx_range_for
|
|
|
|
cxx_rvalue_references
|
|
|
|
cxx_static_assert
|
|
|
|
cxx_strong_enums
|
|
|
|
cxx_trailing_return_types
|
|
|
|
cxx_unicode_literals
|
|
|
|
cxx_user_literals
|
|
|
|
cxx_variable_templates
|
|
|
|
cxx_variadic_macros
|
|
|
|
)
|
2019-12-15 20:33:39 +01:00
|
|
|
endif()
|
2020-02-21 21:15:45 +01:00
|
|
|
|
2020-05-03 18:54:38 +02:00
|
|
|
list(APPEND CATCH_WARNING_TARGETS Catch2 Catch2WithMain)
|
2020-02-21 21:15:45 +01:00
|
|
|
set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE)
|