conan: [package] boost/*: CMakeDeps generator broken for Conan 1.51.0
Package and Environment Details
- Package Name/Version: conan/1.79.0
- Operating System+version: Fedora Linux 36
- Compiler+version: GCC 12
- Conan version: conan 1.51.0
- Python version: Python 3.10.5
Conan profile
conan profile show linux/gcc/debug Configuration for profile linux/gcc/debug:
[settings] os=Linux arch=x86_64 compiler=gcc compiler.version=12 compiler.libcxx=libstdc++11 compiler.cppstd=17 build_type=Debug [options] [conf] [build_requires] [env]
Steps to reproduce
- Use CMakeDeps generator with the Boost package from Conan Center as a
requires
. - Run
conan install
. - Run
conan build
, where the configure stage of CMake will fail.
Logs
Click to expand log
CMake Error at build/Boost-Target-debug.cmake:1274 (target_link_libraries):
Cannot specify link libraries for target "boost::boost" which is not built
by this project.
Call Stack (most recent call first):
build/BoostTargets.cmake:26 (include)
build/BoostConfig.cmake:10 (include)
CMakeLists.txt:1 (find_package)
-- Configuring incomplete, errors occurred!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (15 by maintainers)
I re-created a minimal example project demonstrating the problem. Due to the fact the release notes mentioned GLOBAL target behavior, I deduced the problem only occurred when using multiple
CMakeLists.txt
files throughadd_subdirectory
.CMakeLists.txt
:src/CMakeLists.txt
:I finally manage to reproduce it. Now I can hunt the bug, million thanks for your help.
might be related: https://github.com/conan-io/conan-center-index/pull/11846#issuecomment-1199217795
Thanks MiSo1289, I have an idea now about what is happening.
I attach the
-Target-debug.cmake
file for eigen where I encountered the same issue. I tried to do a minimal reproduction but failed; of note maybe is that eigen is required in the project only transitively through opencv.Error log: