conan-io / conan-io/docs

[question] how can i configure the package's dependencies linkage?

Open
#1,764 1 comment 0 reactions 1 assignee Claimed by @danimtb View on GitHub
stage: triaging type: question
Dominant language
C++
Stars
125
Forks
382
Avg merge
22h 39m
Merged PRs (30d)
21

Description

I have such a problem: library A finds and includes boost through CMake like this:
```
find_package(Boost 1.65.1 COMPONENTS chrono system REQUIRED)
target_link_libraries(A ${Boost_LIBRARIES})
```
boost is a conan package.

then library A becomes a conan package, which i try to include into my project through conan with the help of cmake_find_package generator.

after "conan install . --update" command in my projects's folder, conan creates FindA.cmake file, which, among all, has a line in it:

```
get_target_property(tmp boost::boost INTERFACE_LINK_LIBRARIES)
```
as i understand, this line links ALL boost libraries to my target, instead of linking only chrono and system

ldd on my target also shows dependencies on all boost libraries

The question is: how can i configure conan/cmake to link only the libraries that are really needed

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.