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

Feature/cmaketoolchain abspaths #3726

Merged
Merged
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
18 changes: 18 additions & 0 deletions reference/tools/cmake/cmaketoolchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,24 @@ By default it is ``"conan"``, and it will generate CMake presets named "conan-xx
This is done to avoid potential name clashes with users own presets.


absolute_paths
^^^^^^^^^^^^^^

By default, ``CMakeToolchain`` will generate relative paths. For example the ``CMakeUserPresets.json`` will have a
relative path to the included ``CMakePresets.json`` (both files generated by ``CMakeToolchain``), and the
``CMakePresets.json`` file will have a relative path to the ``conan_toolchain.cmake`` file defined in its ``toolchainFile``
field, that will be relative to the build folder, as specified by the CMake presets documentation.

If for some reason using absolute paths was desired, it is possible to do it with:

.. code:: python

def generate(self):
tc = CMakeToolchain(self)
tc.absolute_paths = True
tc.generate()


Using a custom toolchain file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down