You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/config_files/profiles.rst
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -677,6 +677,11 @@ Some of the capabilities of the profile templates are:
677
677
compiler={{ compiler }}
678
678
compiler.version={{ compiler_version }}
679
679
680
+
If you want to use the original profile file name, instead of the current profile name, for example,
681
+
if the current profile file is called ``common``, and another profile called ``windows-arm`` was doing
682
+
an ``include(common)``, then the ``root_profile_name`` variable will be equal to ``windows-arm``, even
683
+
inside the ``common`` file.
684
+
680
685
- Executing external commands and using their output. The ``subprocess`` module is added to the
681
686
context, so you can use it to execute commands and capture their output.
682
687
Note that Conan startup times for some commands can be affected if the command takes a long
@@ -731,6 +736,19 @@ Some of the capabilities of the profile templates are:
731
736
would be useful to define custom per-package settings or options for multiple packages
732
737
in a large dependency graph.
733
738
739
+
740
+
As a summary, this is the rendering context for profile files (all the items Conan injects):
741
+
742
+
- ``platform``, ``os``, ``subprocess``: The Python ``platform``, ``os`` and ``subprocess`` modules
743
+
- ``profile_dir``: The folder where the current profile file is located
744
+
- ``profile_name``: The current profile file filename
745
+
- ``root_profile_name``: The initial profile that was loaded. It is different of the current ``profile_name`` when there is an ``include(otherprofile)``
746
+
- ``conan_version``: The current Conan version
747
+
- ``detect_api``: This is a full automatic detection API, see below
748
+
- ``context``: The current Conan context, can be ``host``, ``build`` or be ``None``
0 commit comments