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 property feature to MakeDeps #3794

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
31 changes: 31 additions & 0 deletions reference/tools/gnu/makedeps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,37 @@ The ``prefix`` variable is automatically adjusted to the ``package_folder``:
CONAN_BIN_DIRS = $(CONAN_BIN_DIRS_ZLIB)
CONAN_LIBS = $(CONAN_LIBS_ZLIB)

Properties
++++++++++

Makefile variables will be generated for each property set in `package_info()` of all dependencies and their components. Let's take following receipt:

.. code:: python

from conan import ConanFile

class MyLib(ConanFile):

name = "mylib"
version = "1.0"

def package_info(self):
self.cpp_info.set_property("my.prop", "some vale")
self.cpp_info.components["mycomp"].set_property("comp_prop", "comp_value")

The resulting makefile variable assignments would look like this:

.. code-block:: makefile

# mylib/1.0

#[...]
CONAN_PROPERTY_MYLIB_MY_PROP = some value
CONAN_PROPERTY_MYLIB_MYCOMP_COMP_PROP = comp_value

When substituting package names, component names and property names into makefile variable names, the names are converted to uppercase and all characters except `A-Z`, `0-9` and `_` are replaced with `_` (see example above with a dot in the property name). The property value is not modified, it is put to the right side of the variable assignment literally. Any whitespace and special character remain unchagend, no quotation or escaping is applied, because GNU Make is not consistent in escaping spaces and cannot handle whitespaces in path names anyway. Because values with newlines would break the makefile they are skipped and a warning is displayed.


Customization
-------------

Expand Down