You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WSL with ubuntu.22.04 under Windows 11
g++-12 (through apt)
cmake 3.29.2 (through snap)
Conan 2.2.3
The Problem
Situation
The main project uses a library that's also in development.
both use conan and are cmake projects.
The main project uses the conan provider file.
The library not. (Because forbidden)
The library is in editable mode.
The main project also uses the flag --build=editable
Now the special case of the project. The library got every headers (.hpp) in the directory ${PROJECT_SOURCE_DIR}/src.
The libary is for internal use only and uses many, many templates. Seperating files in 2 directories, even through real code is in both groups, is unfavorable and therefore not used.
Error
Not finding /include folder
Now the main Problem. The conan generated cmake files try to include [folder_to_project]/include. This fails because the directory does not exist in my local, editable directory.
Adding an empty include folder solved it, but is annoying.
The reason is, conan cache provides always an "include" folder. My library project not directly.
a testcase for this can be something like
target_sources(testman PUBLIC
FILE_SET HEADERS
FILES"${LIBRARY_SOURCE_DIR}/my/custom/subfolder/testman.hpp"
BASE_DIRS "${LIBRARY_SOURCE_DIR}")
To be more precise here.
That works for conan create . to update the local cache, but not conan editable add . and in main project install with --build=editable
Headers not provided
The previous solution was to create an empty include folder. This solves one error, but as a consequence now we miss the files. The used directory is empty :|
Expected result:
conan in editable mode should work as intended.
suggestion would be to create proper subfolders in the buildfolders identical to conan cache ones.
Assuming
It's also possible that inc include folders can be broken also.
How to reproduce it
as explained prior in more detail
create a lib (conan & cmake)
don't create the folder include
set library to editable mode (conan editable add .)
consume this library.
Have you read the CONTRIBUTING guide?
I've read the CONTRIBUTING guide
The text was updated successfully, but these errors were encountered:
We would need a conanfile.py that helps understanding this issue.
The editables are not magic, they need an explicit definition in the layout() method that matches the local layout at development time, the "editable" layout. If you are not using an include folder which is the default provided for example by cmake_layout(), you will need to customize the cmake_layout default definitions in your layout() method.
Can you please provide a reproducible case with a conanfile.py for the editable (together with the other full files that would be needed to reproduce). Thanks!
[edit]
I forgot the details/summary:
1: the cmake extension adds the directory include per default -> will be ignored for compiles, but in editable mode it is differently included and fails
also
2. the layout method itself needs to be changed to be compatible with editable mode -> extra steps in conanfile.py, that will work.
Describe the bug
System details
WSL with ubuntu.22.04 under Windows 11
g++-12 (through apt)
cmake 3.29.2 (through snap)
Conan 2.2.3
The Problem
Situation
The main project uses a library that's also in development.
both use conan and are cmake projects.
The main project uses the conan provider file.
The library not. (Because forbidden)
The library is in editable mode.
The main project also uses the flag
--build=editable
Now the special case of the project. The library got every headers (
.hpp
) in the directory${PROJECT_SOURCE_DIR}/src
.The libary is for internal use only and uses many, many templates. Seperating files in 2 directories, even through real code is in both groups, is unfavorable and therefore not used.
Error
Not finding
/include
folderNow the main Problem. The conan generated cmake files try to include
[folder_to_project]/include
. This fails because the directory does not exist in my local, editable directory.Adding an empty
include
folder solved it, but is annoying.The reason is, conan cache provides always an "include" folder. My library project not directly.
a testcase for this can be something like
To be more precise here.
That works for
conan create .
to update the local cache, but notconan editable add .
and in main project install with--build=editable
Headers not provided
The previous solution was to create an empty include folder. This solves one error, but as a consequence now we miss the files. The used directory is empty :|
Expected result:
conan in editable mode should work as intended.
suggestion would be to create proper subfolders in the buildfolders identical to conan cache ones.
Assuming
It's also possible that
inc
include folders can be broken also.How to reproduce it
as explained prior in more detail
include
conan editable add .
)Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: