Git Product home page Git Product logo

Comments (7)

memsharded avatar memsharded commented on July 18, 2024 1

On my use case, the conan package has a folder inside "include" with some headers files which do not belong specifically to a component. Then, I guess, I shall refer it on components that depend on.

But you can create a component to refer to those headers, why not creating a "headers" component that define that includedirs? Then you have a way to refer to it. If you want to avoid having duplicated includedirs, then you can define a component .requires to this component with headers from other components using those common headers.

from conan.

memsharded avatar memsharded commented on July 18, 2024 1

Good, thanks for the feedback!

I am closing this question as responded then, don't hesitate to re-open or create new tickets for any further question.

from conan.

memsharded avatar memsharded commented on July 18, 2024

Hi @diogomatos3

Thanks for your question.

The way components works is that when components are defined, they fully invalidate/drop the global cpp_info.xxxdirs information. All information comes from components definition now, it is not possible to have components and at the same time have a global configuration, because having a global configuration means exactly that there are no components.

The the generic variable (conan-package_INCLUDE_DIR). becomes just the aggregation of the components. This variable represents the whole package information, not just a subset excluding the components.

from conan.

diogomatos3 avatar diogomatos3 commented on July 18, 2024

Hi @memsharded,

Thanks a lot for the quick reply and explanation. It fits completely what I have observed.
If you don't mind, one more question... how would be the proper/efficient way to have direct access to "include" folder of the package, in the consumers' cmakelists? Considering that components have different sets of includedirs.

from conan.

memsharded avatar memsharded commented on July 18, 2024

If you don't mind, one more question... how would be the proper/efficient way to have direct access to "include" folder of the package, in the consumers' cmakelists? Considering that components have different sets of includedirs.

That is the thing, there is no include folder of the package, if you define 2 components in one package and one has includedirs =["myinc1"] and the other has includedirs=["myinc2"], the consumer cannot obtain the "include" folder of the package, it doesn't exist. Maybe I am not fully understanding the issue.

Probably there is something else there. From the consumers it shouldn't be needed to get the includedirs and used them explicitly. The includedirs are already included in the generated targets, so just target_link_libraries(mytarget ... mydep::mydep) should be enough to automatically bring the includedirs of the dependencies and successfully find and use them.

from conan.

diogomatos3 avatar diogomatos3 commented on July 18, 2024

Ok, understood. My doubts are clarified.

You got the issue. I was just wondering if there was some way to "reach" include directly. But, like you said if there is components makes no sense to have interest on "include".

On my use case, the conan package has a folder inside "include" with some headers files which do not belong specifically to a component. Then, I guess, I shall refer it on components that depend on.

Thanks!

from conan.

diogomatos3 avatar diogomatos3 commented on July 18, 2024

I like this suggestion: "why not creating a "headers" component that define that includedirs"
It will be my approach. Thanks a lot for the guidance!

from conan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.