question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] Package links against all dependent components instead of one

See original GitHub issue

I’m trying to link against a specific Qt5 component qtCore for example. But for some reason conan links against all components that Qt declares. As a result I end up with a include list in a .vcxproj file That contains all components that Qt has.

… ….......conan\f2d3ec\1\include\QtWebEngine ….......conan\f2d3ec\1\include\QtWebEngineWidgets ….......conan\f2d3ec\1\include\QtPrintSupport ….......conan\f2d3ec\1\include\QtWebEngineCore ….......conan\f2d3ec\1\include\QtPositioning ….......conan\f2d3ec\1\include\QtWebChannel …

class LinkAgainstQtCoreOnly(ConanFile):
    def requirements(self):
        self.requires("qt/5.12.4")

    def package_info(self):
        self.cpp_info.requires = ['qtCore']

The docs say below code snippet would work:

class Library(ConanFile):
    name = 'library'
    requires = "openssl/1.0.2u"

    def package_info(self):
        self.cpp_info.requires = ['openssl::ssl']

In the previous example, the ‘library’ package and transitively all its consumers will link only with the component ssl from the openssl package.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
memshardedcommented, Jan 27, 2022

In any case, @gmikhaile if you are interested in this integration and want to try to contribute it, it would be very welcome. The fact that we don’t have enough time for it doesnt mean that it cannot be done.

1reaction
memshardedcommented, Jan 27, 2022

Hi @gmikhaile

yes, this is totally expected. The qmake integration is not multi-component yet. In fact, this integration still has not been modernized to be ready to be ported to Conan 2.0 (that is, to move it to the from conan.tools.qt package). Sometimes this modernization includes the multi-component support, if there is enough demand for it (so far only CMakeDeps and PkgConfigDeps got it), which doesn’t seem the case yet for QMake.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to avoid `loaded two copies of React` error when ...
The issue is twofold: You cannot have 2 copies of react loaded. npm link creates a symlink, however the "require" doesnt respect the...
Read more >
[feature] How to define dependency on an individual package ...
I have got a package containing pre-built libraries provided by a 3rd party vendor. There are two libraries inside of a package that...
Read more >
You're trying to include Workflow in Package ver 0.2. This ...
Workarounds include, having both the object and the workflow in one package or deploying the workflow via the MDAPI instead of packaging it....
Read more >
Solving the problem with NPM Link and React Hooks - Medium
NPM Link is a useful technique for locally testing unpublished changes in one NPM package, inside another NPM project.
Read more >
Invalid Hook Call Warning - React
You are probably here because you got the following error message: Hooks can only be called inside the body of a function component....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found