Skip to content

Commit 8906863

Browse files
authored
Add property feature to MakeDeps (#3794)
1 parent 0d279c1 commit 8906863

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

reference/tools/gnu/makedeps.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,37 @@ The ``prefix`` variable is automatically adjusted to the ``package_folder``:
6565
CONAN_BIN_DIRS = $(CONAN_BIN_DIRS_ZLIB)
6666
CONAN_LIBS = $(CONAN_LIBS_ZLIB)
6767
68+
Properties
69+
++++++++++
70+
71+
Makefile variables will be generated for each property set in `package_info()` of all dependencies and their components. Let's take following receipt:
72+
73+
.. code:: python
74+
75+
from conan import ConanFile
76+
77+
class MyLib(ConanFile):
78+
79+
name = "mylib"
80+
version = "1.0"
81+
82+
def package_info(self):
83+
self.cpp_info.set_property("my.prop", "some vale")
84+
self.cpp_info.components["mycomp"].set_property("comp_prop", "comp_value")
85+
86+
The resulting makefile variable assignments would look like this:
87+
88+
.. code-block:: makefile
89+
90+
# mylib/1.0
91+
92+
#[...]
93+
CONAN_PROPERTY_MYLIB_MY_PROP = some value
94+
CONAN_PROPERTY_MYLIB_MYCOMP_COMP_PROP = comp_value
95+
96+
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.
97+
98+
6899
Customization
69100
-------------
70101

0 commit comments

Comments
 (0)