Skip to content
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

Add docs for name/version being allowed in build_folder_vars conf #3636

Merged
merged 2 commits into from
Mar 19, 2024
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
4 changes: 2 additions & 2 deletions reference/conanfile/methods/layout.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ self.folders
``conanfile.py`` is relative to the project root. This is particularly useful for
:ref:`layouts with multiple subprojects<examples_conanfile_layout_multiple_subprojects>`

- **self.folders.build_folder_vars** (Defaulted to ``None``): Use settings and options to
produce a different build folder and different CMake presets names.
- **self.folders.build_folder_vars** (Defaulted to ``None``): Use settings, options and/or
``self.name`` and ``self.version`` to produce a different build folder and different CMake presets names.


.. _layout_cpp_reference:
Expand Down
2 changes: 1 addition & 1 deletion reference/tools/cmake/cmake_layout.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Multi-setting/option cmake_layout

The ``folders.build`` and ``conanfile.folders.generators`` can be customized to take into account the ``settings``
and ``options`` and not only the ``build_type``. Use the ``tools.cmake.cmake_layout:build_folder_vars``
conf to declare a list of settings or options:
conf to declare a list of settings, options and/or ``self.name`` and ``self.version``:

.. code:: bash

Expand Down
5 changes: 3 additions & 2 deletions reference/tools/cmake/cmaketoolchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ translated from the current ``settings``:
- By default, preset names will be `conan-xxxx`, but the "conan-" prefix can be
customized with the `CMakeToolchain.presets_prefix = "conan"` attribute.
- Preset names are controlled by the `layout()` `self.folders.build_folder_vars`
definition, which can contain a list of settings and options like
definition, which can contain a list of settings, options and/or
``self.name`` and ``self.version`` like
`["settings.compiler", "settings.arch", "options.shared"]`.
- If CMake is found as a direct `tool_requires` dependency, or if
`tools.cmake:cmake_program` is set, the configure preset will include a
Expand Down Expand Up @@ -576,7 +577,7 @@ CMakeToolchain is affected by these ``[conf]`` variables:
- **tools.cmake.cmaketoolchain:system_processor** is not necessary in most cases and is only used to force-define ``CMAKE_SYSTEM_PROCESSOR``.
- **tools.cmake.cmaketoolchain:toolset_arch**: Will add the ``,host=xxx`` specifier in the ``CMAKE_GENERATOR_TOOLSET`` variable of ``conan_toolchain.cmake`` file.
- **tools.cmake.cmaketoolchain:toolset_cuda**: (Experimental) Will add the ``,cuda=xxx`` specifier in the ``CMAKE_GENERATOR_TOOLSET`` variable of ``conan_toolchain.cmake`` file.
- **tools.cmake.cmake_layout:build_folder_vars**: Settings and Options that will produce a different build folder and different CMake presets names.
- **tools.cmake.cmake_layout:build_folder_vars**: Settings, Options, and/or ``self.name`` and ``self.version`` that will produce a different build folder and different CMake presets names.
- **tools.cmake.cmaketoolchain:presets_environment**: Set to ``'disabled'`` to prevent the addition of the environment section to the generated CMake presets.
- **tools.build:cxxflags** list of extra C++ flags that will be appended to ``CMAKE_CXX_FLAGS_INIT``.
- **tools.build:cflags** list of extra of pure C flags that will be appended to ``CMAKE_C_FLAGS_INIT``.
Expand Down