-
Notifications
You must be signed in to change notification settings - Fork 945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] GNUInstallDirs not working as expected with conan build and conan export-pkg #14733
Comments
It works if I add:
to CmakeLists.txt |
Hi @maitrey Thanks for your question. Some other side observation: You typically don't want to set |
Thats the solution to my problem. When I use conan build + conan export-pkg , and I use CMAKE_INSTALL_INCLUDEDIR it points to the output folder instead of outputfolder/include. If I include include(GNUInstallDirs) in CMakeLists.txt , only then it works. Another point that I noted is, I need to check the dependencies in the recipes in order to exclude the include header of dependencies in the test reports(static code analysis):
This points to conan cache which is in my user home. I expected that it points to the folder specified in -of of the conan build command. |
When I check the code of conan I only find one mention of
|
Hi @maitrey I am still not fully sure what would be the question here. The Please let me know if this clarifies the question, thanks! |
I use conan build -of along with conan export-pkg. If I use conan create I donot need to use include(GNUInstallDirs) .
While when I used conan build -of without include(GNUInstallDirs) it fails with:
The toolchain.cmake is not having the CMAKE_INSTALL_LIBDIR set.
|
I have run into a similar issue. If I build with
If we don't specify the @memsharded - can you comment on this, please? Is it a bug or is there something that I need to be doing in the conanfile to get the two generator files to match? Obviously, I wouldn't want the prefix to be defined for |
Well, if I understand this correctly, this sounds something intrinsic to the CMake flow:
I don't think that it is possible to do anything regarding this, it is an intrinsic issue of the CMake configuration + build + install flow, and unless a new re-build would be launched, it would be impossible for Conan to define those variables correctly, and in that case a I think this can be closed as "won't fix", because it looks like an unsolvable issue. |
I understand why |
Oh, I see what you mean now. It is true that it might be possible to define them with relative paths (it seems that in the cache they are defined with absolute paths, which is allowed by CMake, but defining relative paths is recommended apparently). Let's have a look and try to make these variables relative paths and independent of the |
I am creating PR #16214, for next Conan release that defines such CMAKE_INSTALL_XXXDIRS, also for the local flow. If you want to give it a try from source code, that would also be good feedback, otherwise, it will be included in next Conan 2.4. Thanks for the feedback! |
Closed by #16214, it will be in next Conan 2.4 |
Sorry for the delay in my response. I confirmed that #16214 corrects this issue on my end. Only set(CMAKE_INSTALL_PREFIX) differs between the two toolchain files now as expected.
Thanks for making that correction! |
Thanks for the feedback @Tails86! |
What is your question?
Dear Conan Folks,
Conan Version: 2.0.5
I was using all this while conan create and with that all the GNUInstallDirs were somehow defined.
However, when I use the command conan build + conan export-pkg like this:
I see some definitions are not set : ${CMAKE_INSTALL_LIBDIR} , ${CMAKE_INSTALL_INCLUDEDIR} .
My recipe uses : cmake.build and cmake.install()
The documentation of CMake looks different from 1.x to 2.x:
https://docs.conan.io/2.0/reference/tools/cmake/cmake.html
https://docs.conan.io/1/reference/build_helpers/cmake.html?highlight=cmake_install_libdir
Recipe looks like this:
And cmakelists looks like this:
Do I need to specify somewhere in some method explicitly?
Could someone please help me?
Thanks for your help!
Br
Maitrey
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: