Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-05-21 13:04:09 +0200
committerMartin Hořeňovský2022-05-21 13:04:09 +0200
commit3a18a688a07e3f7217d7a1b0ae45a324edfdef52 (patch)
treef9cae93f97fea10432cacfc37cbda67105115699 /docs
parent605a34765aa5d5ecbf476b4598a862ada971b0cc (diff)
downloadcatch3-3a18a688a07e3f7217d7a1b0ae45a324edfdef52.tar.gz
Mention CMake's integration with CATCH_CONFIG options
Diffstat (limited to 'docs')
-rw-r--r--docs/cmake-integration.md26
1 files changed, 26 insertions, 0 deletions
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)<br>
[Automatic test registration](#automatic-test-registration)<br>
[CMake project options](#cmake-project-options)<br>
+[`CATCH_CONFIG_*` customization options in CMake](#catch_config_-customization-options-in-cmake)<br>
[Installing Catch2 from git repository](#installing-catch2-from-git-repository)<br>
[Installing Catch2 from vcpkg](#installing-catch2-from-vcpkg)<br>
@@ -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