conan-io / conan-io/docs

CppInfo Components shows cmake_file_name twice

Closed
#4,266 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
125
Forks
382
Avg merge
22h 39m
Merged PRs (30d)
21

Description

When reading the Components section in package_info, I can find the following example code:

```python
def package_info(self):
self.cpp_info.components["crypto"].set_property("cmake_file_name", "Crypto")
self.cpp_info.components["crypto"].libs = ["libcrypto"]
self.cpp_info.components["crypto"].defines = ["DEFINE_CRYPTO=1"]
self.cpp_info.components["crypto"].requires = ["zlib::zlib"] # Depends on all components in zlib package

self.cpp_info.components["ssl"].set_property("cmake_file_name", "SSL")
self.cpp_info.components["ssl"].includedirs = ["include/headers_ssl"]
self.cpp_info.components["ssl"].libs = ["libssl"]
```

Reference: https://docs.conan.io/2/reference/conanfile/methods/package_info.html#components

However, it's not possible to generate two separate CMake config files using `CMakeDeps`, neither `CMakeConfigDeps`, instead, it will generate `Config.cmake`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.