Skip to content

Commit 5e626a8

Browse files
committed
Updated changes with new version of extra_variables
1 parent 1de2793 commit 5e626a8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

reference/tools/cmake/cmaketoolchain.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,11 +625,21 @@ CMakeToolchain is affected by these ``[conf]`` variables:
625625
- **tools.cmake.cmaketoolchain:system_name** is not necessary in most cases and is only used to force-define ``CMAKE_SYSTEM_NAME``.
626626
- **tools.cmake.cmaketoolchain:system_version** is not necessary in most cases and is only used to force-define ``CMAKE_SYSTEM_VERSION``.
627627
- **tools.cmake.cmaketoolchain:system_processor** is not necessary in most cases and is only used to force-define ``CMAKE_SYSTEM_PROCESSOR``.
628-
- **tools.cmake.cmaketoolchain:extra_variables**: dict-like python object which specifies the CMake variable name and value. E.g.
628+
- **tools.cmake.cmaketoolchain:extra_variables**: dict-like python object which specifies the CMake variable name and value. Value can be a plain string, number or a dict-like python object which must specifies ``value`` (string/number) , ``cache`` (boolean), ``type`` (CMake cache type) and ``docstring`` (string). Potential override of CMakeToolchain defined variables, users are at their own risk. E.g.
629629

630-
.. code:: bash
630+
.. code-block:: text
631+
632+
[conf]
633+
tools.cmake.cmaketoolchain:extra_variables*={'STR': 'string value', 'NUM': 1.3, 'CMAKE_GENERATOR_INSTANCE': '${ENV}/buildTools/', 'SOME_DICT': {'value': '42 sense', 'cache': 'true', 'type': 'BOOL', 'docstring': 'test cache var'}}
634+
635+
Resulting in:
636+
637+
.. code-block:: cmake
631638
632-
conan install . -c "tools.cmake.cmaketoolchain:extra_variables*={'CMAKE_GENERATOR_INSTANCE': 'C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/'}"
639+
set(STR "string value")
640+
set(NUM 1.3)
641+
set(CMAKE_GENERATOR_INSTANCE "${ENV}/buildTools/")
642+
set(SOME_DICT "42 sense" CACHE BOOL "test cache var")
633643
634644
.. tip::
635645

0 commit comments

Comments
 (0)