From 52671dcf5b58e3caa3673f4eedd9685b482d6779 Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Wed, 8 Dec 2021 14:39:48 +0100 Subject: [PATCH] Improve documentation for conditions --- docs/cmake-toml.md | 18 +++++++++++++++++- docs/google13f7c659b54c069f.html | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 docs/google13f7c659b54c069f.html diff --git a/docs/cmake-toml.md b/docs/cmake-toml.md index 71b5494..da65839 100644 --- a/docs/cmake-toml.md +++ b/docs/cmake-toml.md @@ -39,12 +39,28 @@ include-after = ["cmake/after-project.cmake"] ## Conditions +You can specify your own conditions and use them in any `condition` field: + ```toml [conditions] arch64 = "CMAKE_SIZEOF_VOID_P EQUALS 8" arch32 = "CMAKE_SIZEOF_VOID_P EQUALS 4" ``` +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): + +```toml +[conditions] +windows = "WIN32" +macos = "CMAKE_SYSTEM_NAME MATCHES \"Darwin\"" +unix = "UNIX" +bsd = "CMAKE_SYSTEM_NAME MATCHES \"BSD\"" +linux = "CMAKE_SYSTEM_NAME MATCHES \"Linux\"" +gcc = "CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" OR CMAKE_C_COMPILER_ID STREQUAL \"GNU\"" +clang = "CMAKE_CXX_COMPILER_ID MATCHES \"Clang\" OR CMAKE_C_COMPILER_ID MATCHES \"Clang\"" +msvc = "MSVC" +``` + ## Subdirectories ```toml @@ -69,7 +85,7 @@ url = "https://github.com/microsoft/vcpkg/archive/refs/tags/2021.05.12.tar.gz" packages = ["fmt", "zlib"] ``` -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`). +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). ## Packages diff --git a/docs/google13f7c659b54c069f.html b/docs/google13f7c659b54c069f.html new file mode 100644 index 0000000..f028cd3 --- /dev/null +++ b/docs/google13f7c659b54c069f.html @@ -0,0 +1 @@ +google-site-verification: google13f7c659b54c069f.html \ No newline at end of file