mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-18 00:02:21 +08:00
Help: presets: add note for ExternalProject users with env vars
Although this behavior is implied in the existing help text, I think this use case is common and could be puzzling to those who do not thoroughly read the existing help text. I think that warrants a "Note:" on this page.
This commit is contained in:

committed by
Brad King

parent
acb25d50d9
commit
b00512e692
@@ -401,6 +401,19 @@ that may contain the following fields:
|
|||||||
are applied. Setting a variable to ``null`` causes it to not be set,
|
are applied. Setting a variable to ``null`` causes it to not be set,
|
||||||
even if a value was inherited from another preset.
|
even if a value was inherited from another preset.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
For a CMake project using ExternalProject with a configuration preset
|
||||||
|
having environment variables needed in the ExternalProject, use a build
|
||||||
|
preset that inherits that configuration preset or the ExternalProject
|
||||||
|
will not have the environment variables set in the configuration preset.
|
||||||
|
Example: suppose the host defaults to one compiler (say Clang)
|
||||||
|
and the user wishes to use another compiler (say GCC). Set configuration
|
||||||
|
preset environment variables ``CC`` and ``CXX`` and use a build preset
|
||||||
|
that inherits that configuration preset. Otherwise the ExternalProject
|
||||||
|
may use a different (system default) compiler than the top-level CMake
|
||||||
|
project.
|
||||||
|
|
||||||
``configurePreset``
|
``configurePreset``
|
||||||
|
|
||||||
An optional string specifying the name of a configure preset to
|
An optional string specifying the name of a configure preset to
|
||||||
|
Reference in New Issue
Block a user