From d94defd2bab60d263ef49fc670866ab9937f14f1 Mon Sep 17 00:00:00 2001 From: danimtb Date: Wed, 13 Jan 2021 17:56:32 +0100 Subject: [PATCH] Docs for build modules per generator in cpp_info --- reference/conanfile/attributes.rst | 5 +++-- reference/conanfile/methods.rst | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reference/conanfile/attributes.rst b/reference/conanfile/attributes.rst index 1255868f428f..b62be4e72b86 100644 --- a/reference/conanfile/attributes.rst +++ b/reference/conanfile/attributes.rst @@ -939,8 +939,9 @@ This object should be filled in ``package_info()`` method. +--------------------------------------+---------------------------------------------------------------------------------------------------------+ | self.cpp_info.system_libs | Ordered list with the system library names. Defaulted to ``[]`` (empty) | +--------------------------------------+---------------------------------------------------------------------------------------------------------+ -| self.cpp_info.build_modules | | List of relative paths to build system related utility module files created by the package. Used by | -| | | CMake generators to export *.cmake* files with functions for consumers. Defaulted to ``[]`` (empty) | +| self.cpp_info.build_modules | | Dictionary of lists per generator containing relative paths to build system related utility module | +| | | files created by the package. Used by CMake generators to export *.cmake* files with functions for | +| | | consumers. Defaulted to ``{}`` (empty) | +--------------------------------------+---------------------------------------------------------------------------------------------------------+ | self.cpp_info.components | | **[Experimental]** Dictionary with different components a package may have: libraries, executables... | | | | **Warning**: Using components with other ``cpp_info`` non-default values or configs is not supported | diff --git a/reference/conanfile/methods.rst b/reference/conanfile/methods.rst index 07193b962eab..643062481093 100644 --- a/reference/conanfile/methods.rst +++ b/reference/conanfile/methods.rst @@ -217,7 +217,7 @@ The :ref:`cpp_info_attributes_reference` attribute has the following properties self.cpp_info.resdirs = ['res'] # Directories where resources, data, etc. can be found self.cpp_info.bindirs = ['bin'] # Directories where executables and shared libs can be found self.cpp_info.srcdirs = [] # Directories where sources can be found (debugging, reusing sources) - self.cpp_info.build_modules = [] # Build system utility module files + self.cpp_info.build_modules = {} # Build system utility module files self.cpp_info.defines = [] # preprocessor definitions self.cpp_info.cflags = [] # pure C flags self.cpp_info.cxxflags = [] # C++ compilation flags @@ -249,8 +249,8 @@ The :ref:`cpp_info_attributes_reference` attribute has the following properties - **srcdirs**: List of relative paths (starting from the package root) of directories in which to find sources (like .c, .cpp). By default it is empty. It might be used to store sources (for later debugging of packages, or to reuse those sources building them in other packages too). -- **build_modules**: List of relative paths to build system related utility module files created by the package. Used by CMake generators to - include *.cmake* files with functions for consumers. e.g: ``self.cpp_info.build_modules.append("cmake/myfunctions.cmake")``. Those files +- **build_modules**: Dictionary of lists per generator containing relative paths to build system related utility module files created by the package. Used by CMake generators to + include *.cmake* files with functions for consumers. e.g: ``self.cpp_info.build_modules["cmake_find_package"].append("cmake/myfunctions.cmake")``. Those files will be included automatically in `cmake`/`cmake_multi` generators when using `conan_basic_setup()` and will be automatically added in `cmake_find_package`/`cmake_find_package_multi` generators when `find_package()` is used. - **defines**: Ordered list of preprocessor directives. It is common that the consumers have to specify some sort of defines in some cases,