Skip to content

profile composition #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions reference/profiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,28 @@ Your build tool will locate **clang** compiler only for the **zlib** package and
[env]
PATH=[/some/path/to/my/tool]

Profile composition
-------------------

You can specify multiple profiles in the command line. The applied configuration will be the composition
of all the profiles applied in the order they are specified.

If, for example, you want to apply a :ref:`build require<build_requires>`, like a ``cmake`` installer to your dependency tree,
it won't be very practical adding the `cmake` installer reference, e.g ``cmake_installer/3.9.0@conan/stable`` to all your profiles where you could
need to inject ``cmake`` as a build require.

You can specify both profiles instead:

.. code-block:: text
:caption: *.conan/profiles/cmake_39*

[build_requires]
cmake_installer/3.9.0@conan/stable

.. code-block:: bash

$ conan install . --profile clang --profile cmake_39

Profile includes
----------------

Expand Down
9 changes: 8 additions & 1 deletion using_packages/using_profiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Using profiles

So far, we have used the default settings stored in ``~/.conan/profiles/default`` and defined as command line arguments.

However, in large projects, configurations can get complex, settings can be very different, and we need an easy way to switch between different configurations with different settings, options etc,.
However, in large projects, configurations can get complex, settings can be very different, and we need an easy way to switch between different configurations with different settings, options etc,.
An easy way to switch between configurations is by using profiles.

A profile file contains a predefined set of ``settings``, ``options``, ``environment variables``, and ``build_requires`` specified in the following structure:
Expand Down Expand Up @@ -97,6 +97,13 @@ To install dependencies using this new profile, we would use:

$ conan install . -pr=./poco_clang_3.5

You can specify multiple profiles in the command line. The applied configuration will be the composition
of all the profiles applied in the order they are specified:

.. code-block:: bash

$ conan install . -pr=./poco_clang_3.5 -pr=my_build_tool1 -pr=my_build_tool2

.. seealso::

Read more about :ref:`profiles` for full reference. There is a Conan command, :ref:`conan_profile`,
Expand Down