[question] Setting editable layout directories for find_package components
See original GitHub issueI 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:
- Created 2 years ago
- Reactions:1
- Comments:9 (4 by maintainers)

Top Related StackOverflow Question
I do understand now. I will take a look into CMakeDeps and CMakeToolchain then. Thanks for the support.
@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.buildlayout, and the issue you are reporting seems connected toself.cpp.packagelayout, I would still give it a try, might not be connected.