Skip to content

Commit 52671dc

Browse files
committed
Improve documentation for conditions
1 parent 094bab1 commit 52671dc

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

docs/cmake-toml.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,28 @@ include-after = ["cmake/after-project.cmake"]
3939

4040
## Conditions
4141

42+
You can specify your own conditions and use them in any `condition` field:
43+
4244
```toml
4345
[conditions]
4446
arch64 = "CMAKE_SIZEOF_VOID_P EQUALS 8"
4547
arch32 = "CMAKE_SIZEOF_VOID_P EQUALS 4"
4648
```
4749

50+
This will make the `arch64` and `arch32` conditions available with their respective CMake expressions. The following conditions are predefined (you can override them if you desire):
51+
52+
```toml
53+
[conditions]
54+
windows = "WIN32"
55+
macos = "CMAKE_SYSTEM_NAME MATCHES \"Darwin\""
56+
unix = "UNIX"
57+
bsd = "CMAKE_SYSTEM_NAME MATCHES \"BSD\""
58+
linux = "CMAKE_SYSTEM_NAME MATCHES \"Linux\""
59+
gcc = "CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" OR CMAKE_C_COMPILER_ID STREQUAL \"GNU\""
60+
clang = "CMAKE_CXX_COMPILER_ID MATCHES \"Clang\" OR CMAKE_C_COMPILER_ID MATCHES \"Clang\""
61+
msvc = "MSVC"
62+
```
63+
4864
## Subdirectories
4965

5066
```toml
@@ -69,7 +85,7 @@ url = "https://github.com/microsoft/vcpkg/archive/refs/tags/2021.05.12.tar.gz"
6985
packages = ["fmt", "zlib"]
7086
```
7187

72-
The vcpkg `version` will automatically generate the `url` from the official repository. For a custom registry you can specify your own `url` (and omit the `version`).
88+
The vcpkg `version` will automatically generate the `url` from the [official repository](https://github.com/microsoft/vcpkg/releases). For a custom registry you can specify your own `url` (and omit the `version`). You can browse available packages on [vcpkg.io](https://vcpkg.io/en/packages.html).
7389

7490
## Packages
7591

docs/google13f7c659b54c069f.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-site-verification: google13f7c659b54c069f.html

0 commit comments

Comments
 (0)