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] Setting editable layout directories for find_package components

See original GitHub issue

I am introducing conan in the company I work for. One of the things to deal with now is that we occasionally need to work in multiple repositories at the same time (previously done using sub-modules). This is needed to update the library API and at the same time update the repository that consumes the library.

According to the conan documentation, this can be achieved using conan editable packages together with layout files. When used with packages that do not make use of components, the editable package include directories are picked up correctly. In this case I link my targets using CONAN_PKG::mypackage.

The package that I am working on now is using components. I had to use the find_package generator in order to link the components to the targets. My CMake file will contain the following snippet to link the component:

find_package(mypackage REQUIRED COMPONENTS base v0)
target_link_library(mytarget PRIVATE mypackage::base)

In this case I would also like to use the conan editable layout file, but it seems that the [includedirs] are not taken into account for components. My layout file looks as follows:

[includedirs]
src/base/export
src/v0/export

How can I set the includedirs per component for use with conan editable packages?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jlemeincommented, Jul 21, 2021

I do understand now. I will take a look into CMakeDeps and CMakeToolchain then. Thanks for the support.

1reaction
memshardedcommented, Jul 20, 2021

@gmikhaile Thanks for reporting, we are going to have a look at the other issue.

However, this might work, as it is using the self.cpp.build layout, and the issue you are reporting seems connected to self.cpp.package layout, I would still give it a try, might not be connected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[question] Using cmake_find_package with a project ... - GitHub
I think I know where the issue is. When defining components, their layout for editable mode needs to be defined also in the...
Read more >
find_package — CMake 3.25.1 Documentation
A cache entry called <PackageName>_DIR is created to hold the directory containing the file. By default, the command searches for a package with...
Read more >
ing in Visual Studio does not discover include directories ...
In my project I am using: find_package(PCL REQUIRED COMPONENTS common io search features registration) ...
Read more >
CMake Tutorial EP 9 | find_package modules and ... - YouTube
Talking more about libraries and other ways of having your CMake find them by using the find_package option.UPDATE: I will be redoing this ......
Read more >
Adding dependencies to a package - ROS Answers
I have a package which makes use of the rosbridge package. I defined the find_package section of my CMakeLists.txt like so : find_package(catkin ......
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