Skip to content

Commit

Permalink
Docs for 11673 (#2664)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasote committed Jul 28, 2022
1 parent 374f56f commit c5bda1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion migrating_to_2.0/properties.rst
Expand Up @@ -161,7 +161,8 @@ Could be declared like this with the properties model:
def package_info(self):
...
self.cpp_info.components["mycomponent"].set_property("cmake_target_name", "component_namespace::mycomponent-name")
self.cpp_info.components["mycomponent"].set_property("cmake_build_modules", [os.path.join("lib", "mypkg_bm.cmake")])
# The property "cmake_build_modules" can't be declared in a component, do it in self.cpp_info
self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "mypkg_bm.cmake")])
self.cpp_info.components["mycomponent"].set_property("pkg_config_name", "mypkg-config-name")
self.cpp_info.components["mycomponent"].set_property("custom_name", "mycomponent-name", "custom_generator")
...
Expand Down
2 changes: 1 addition & 1 deletion migrating_to_2.0/recipes.rst
Expand Up @@ -673,7 +673,7 @@ New properties defined for *CMake* generators family, used by :ref:`CMakeDeps<CM
- **cmake_target_name** property will define the absolute target name in ``CMakeDeps``
- **cmake_module_file_name** property defines the generated filename for modules (``Findxxxx.cmake``)
- **cmake_module_target_name** defines the absolute target name for find modules.
- **cmake_build_modules** property replaces the ``build_modules`` property.
- **cmake_build_modules** property replaces the ``build_modules`` property. It can't be declared in a component, do it in ``self.cpp_info``.
- **cmake_find_mode** will tell :ref:`CMakeDeps<CMakeDeps>` to generate config
files, modules files, both or none of them, depending on the value set (``config``,
``module``, ``both`` or ``none``)
Expand Down
6 changes: 3 additions & 3 deletions reference/conanfile/tools/cmake/cmakedeps.rst
Expand Up @@ -184,7 +184,7 @@ The following properties affect the CMakeDeps generator:
- **cmake_module_file_name**: Same as **cmake_file_name** but when generating modules with ``cmake_find_mode=module/both``. If not specified it will default to **cmake_file_name**.
- **cmake_module_target_name**: Same as **cmake_target_name** but when generating modules with ``cmake_find_mode=module/both``. If not specified it will default to **cmake_target_name**.
- **cmake_build_modules**: List of ``.cmake`` files (route relative to root package folder) that are automatically
included when the consumer run the ``find_package()``.
included when the consumer run the ``find_package()``. This property can't be declared in a component, do it in the global ``self.cpp_info``.
- **cmake_set_interface_link_directories**: boolean value that should be only used by dependencies that don't declare `self.cpp_info.libs` but have ``#pragma comment(lib, "foo")`` (automatic link) declared at the public headers. Those dependencies should
add this property to their *conanfile.py* files at root ``cpp_info`` level (components not supported for now).

Expand All @@ -201,10 +201,10 @@ Example:
# Create a new target "MyFooAlias" that is an alias to the "Foo::Foo" target
self.cpp_info.set_property("cmake_target_aliases", ["MyFooAlias"])
# The property "cmake_build_modules" can't be declared in a component, do it in self.cpp_info
self.cpp_info.set_property("cmake_build_modules", [os.path.join("lib", "mypkg.cmake")])
self.cpp_info.components["mycomponent"].set_property("cmake_target_name", "Foo::Var")
# Automatically include the lib/mypkg.cmake file when calling find_package()
self.cpp_info.components["mycomponent"].set_property("cmake_build_modules", [os.path.join("lib", "mypkg.cmake")])
# Create a new target "VarComponent" that is an alias to the "Foo::Var" component target
self.cpp_info.components["mycomponent"].set_property("cmake_target_aliases", ["VarComponent"])
Expand Down

0 comments on commit c5bda1b

Please sign in to comment.