Skip to content

Commit

Permalink
self.cpp_info.builddirs defaults (conan-io#2365)
Browse files Browse the repository at this point in the history
* self.cpp_info.builddirs defaults

* better now
  • Loading branch information
lasote authored Feb 1, 2022
1 parent 909ca02 commit 9e2c4ef
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion conan_v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,21 @@ Conan won't alter any symlink while exporting or packaging files.
If any manipulation to the symlinks is required, the package :ref:`conan.tools.files.symlinks<conan_tools_files_symlinks>`
contains some tools to help with that.

Default cpp_info.builddirs
--------------------------

The default root package folder (``self.cpp_info.builddirs = ['']``) has been removed. Also assign it
will be discouraged because it affects how :ref:`CMakeToolchain<conan-cmake-toolchain>` and
:ref:`CMakeDeps<CMakeDeps>` locate executables, libraries, headers... from the right context (host vs build).

To be prepared for Conan 2.0:

- If you have *cmake modules* or *cmake config files* at the root of the package, it is strongly recommended to move them
to a subfolder ``cmake`` and assing it: ``self.cpp_info.builddirs = ["cmake"]``
- If you are not assigning any ``self.cpp_info.builddirs`` assign an empty list: ``self.cpp_info.builddirs = []``.
- Instead of appending new values to the default list, assign it: ``self.cpp_info.builddirs = ["cmake"]``


.. _conanv2_properties_model:

New properties model for the cpp_info in Conan 2.0 generators
Expand Down Expand Up @@ -198,4 +213,4 @@ Using ``set_property()`` you can pass the parameters of your choice and read the
self.cpp_info.components["mycomponent"].set_property("custom_property", "prop_value")
...
Please **check a detailed migration guide** in the :ref:`dedicated section <properties_migration>`.
Please **check a detailed migration guide** in the :ref:`dedicated section <properties_migration>`.

0 comments on commit 9e2c4ef

Please sign in to comment.