Skip to content

Commit ec22cf9

Browse files
perseoGIAbrilRBS
andauthored
Documented usage of force option on tools.cmake.cmaketoolchain:extra_variables (#3774)
Co-authored-by: Rubén Rincón Blanco <[email protected]>
1 parent e4a0931 commit ec22cf9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

reference/tools/cmake/cmaketoolchain.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ CMakeToolchain is affected by these ``[conf]`` variables:
653653
- **tools.cmake.cmaketoolchain:system_name** is not necessary in most cases and is only used to force-define ``CMAKE_SYSTEM_NAME``.
654654
- **tools.cmake.cmaketoolchain:system_version** is not necessary in most cases and is only used to force-define ``CMAKE_SYSTEM_VERSION``.
655655
- **tools.cmake.cmaketoolchain:system_processor** is not necessary in most cases and is only used to force-define ``CMAKE_SYSTEM_PROCESSOR``.
656-
- **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 optionally, ``docstring`` (string: defaulted to variable name). Potential override of CMakeToolchain defined variables, users are at their own risk. E.g.
656+
- **tools.cmake.cmaketoolchain:extra_variables**: dict-like python object which specifies the CMake variable name and value. The value can be a plain string, a number or a dict-like python object which must specify the ``value`` (string/number) , ``cache`` (boolean), ``type`` (CMake cache type) and optionally, ``docstring`` (string: defaulted to variable name) and ``force`` (boolean) keys. It can override CMakeToolchain defined variables, for which users are at their own risk. E.g.
657657

658658
.. code-block:: text
659659
@@ -673,15 +673,15 @@ Another advanced usage:
673673
.. code-block:: text
674674
675675
tools.cmake.cmaketoolchain:extra_variables={'MyIntegerVariable': 42, 'CMAKE_GENERATOR_INSTANCE': '${ENV}/buildTools/'}
676-
tools.cmake.cmaketoolchain:extra_variables*={'CACHED_VAR': {'value': '/var/run', 'cache': True, 'type': 'PATH', 'docstring': 'test cache var'}}
676+
tools.cmake.cmaketoolchain:extra_variables*={'CACHED_VAR': {'value': '/var/run', 'cache': True, 'type': 'PATH', 'docstring': 'test cache var', 'force': True}}
677677
678678
Resulting in:
679679

680680
.. code-block:: cmake
681681
682682
set(MyIntegerVariable 42)
683683
set(CMAKE_GENERATOR_INSTANCE "${ENV}/buildTools/")
684-
set(CACHED_VAR "/var/run" CACHE BOOL "test cache var")
684+
set(CACHED_VAR "/var/run" CACHE BOOL "test cache var" FORCE)
685685
686686
This block injects ``$`` which will be expanded later. It also defines a cache variable of type ``PATH``.
687687

0 commit comments

Comments
 (0)