[bug] CMake generator does not allow multiple namespaces for the exported library.
See original GitHub issueThis affects at least Qt5, Qt6 and most of the libraries on the KDE Frameworks. I’d assume more libraries use this but those are the ones I have to work on daily.
Qt5 exports Qt::
and Qt5::
namespaces, qt6 exports Qt::
and Qt6::
namespaces on their original find modules,
and it’s important that we can rely on this for the generated find modules, so that code made for both Qt5 and Qt6 works.
I’m new to conan but I’m quite interested in improving it.
my proposal is to add a metadata on the recipe of such modules:
lass QtConan(ConanFile):
generators = "pkg_config", "cmake_find_package", "cmake"
name = "qt"
cmake_find_package_namespaces = ["Qt", "Qt6"]
and when we run the cmake_find_package generator, we iterate trougth that list, and generate everything for all the cases.
conan-center related issue: https://github.com/conan-io/conan-center-index/issues/6459
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Problems with exported targets inside namespace which are ...
I stumbled upon an issue (newest CMake Version 3.14): Take this example where I am adding three libraries. All of them are exported...
Read more >cmake-packages(7) — CMake 3.25.1 Documentation
A NAMESPACE with double-colons is specified when exporting the targets for installation. This convention of double-colons gives CMake a hint that the name...
Read more >CMake: Best Practices
Build system generator. Understands the files you are building. System independent. You give relationships. Can find libraries, etc. CMake is two-stage; ...
Read more >CMake: enforcing a relationship between namespaces and ...
It seems that CMake does not support defining a relationship between the namespace of an exported or installed target and the name of...
Read more >Creating a C++ library with CMake - Declaration of VAR
Making a library with CMake is not that different from making an application - instead of add_executable you call add_library.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@czoido the new
cmake_target_name
logic fixes this issue I think.Yes I would. give me a couple of days to familiarize with the codebase.