From 3a18a688a07e3f7217d7a1b0ae45a324edfdef52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sat, 21 May 2022 13:04:09 +0200 Subject: [PATCH] Mention CMake's integration with CATCH_CONFIG options --- docs/cmake-integration.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/cmake-integration.md b/docs/cmake-integration.md index 88425353..49330083 100644 --- a/docs/cmake-integration.md +++ b/docs/cmake-integration.md @@ -5,6 +5,7 @@ [CMake targets](#cmake-targets)
[Automatic test registration](#automatic-test-registration)
[CMake project options](#cmake-project-options)
+[`CATCH_CONFIG_*` customization options in CMake](#catch_config_-customization-options-in-cmake)
[Installing Catch2 from git repository](#installing-catch2-from-git-repository)
[Installing Catch2 from vcpkg](#installing-catch2-from-vcpkg)
@@ -293,6 +294,31 @@ compiled separately to ensure that they are self-sufficient. Defaults to `OFF`. +## `CATCH_CONFIG_*` customization options in CMake + +> CMake support for `CATCH_CONFIG_*` options was introduced in Catch2 3.0.1 + +Due to the new separate compilation model, all the options from the +[Compile-time configuration docs](configuration.md#top) can also be set +through Catch2's CMake. To set them, define the option you want as `ON`, +e.g. `-DCATCH_CONFIG_NOSTDOUT=ON`. + +Note that setting the option to `OFF` doesn't disable it. To force disable +an option, you need to set the `_NO_` form of it to `ON`, e.g. +`-DCATCH_CONFIG_NO_COLOUR_WIN32=ON`. + + +To summarize the configuration option behaviour with an example: + +| `-DCATCH_CONFIG_COLOUR_WIN32` | `-DCATCH_CONFIG_NO_COLOUR_WIN32` | Result | +|-------------------------------|----------------------------------|-------------| +| `ON` | `ON` | error | +| `ON` | `OFF` | force-on | +| `OFF` | `ON` | force-off | +| `OFF` | `OFF` | auto-detect | + + + ## Installing Catch2 from git repository If you cannot install Catch2 from a package manager (e.g. Ubuntu 16.04