-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[bug] GNUInstallDirs seem to be overridden by CMakeToolchain-generated files #17802
Comments
We were able to override by setting the toolchain variables to the desired values, but I would still rather not override GNUInstallDirs. |
Hi @glennaycock Thanks for your feedback.
This was very necessary, because the problem with GNUInstallDirs defines different directories even for different distros. def package(self):
cmake = CMake(self)
cmake.install()
def layout(self):
self.cpp.package.libdirs = ["lib"] # this is the default
... Then, that recipe will be broken because in some systems the libdir will not be "lib" but "lib64". This was creating a multitude of unexpected issues in many Conan recipes, both public in ConanCenter, but also affecting proprietary recipes. And the worst thing is that the logic to know that is not that straightforward, it would require something like def layout(self):
if (we are in one of those distros (list of all distros?) that create lib64):
self.cpp.package.libdirs = ["lib64"]
else:
self.cpp.package.libdirs = ["lib"] # this is the default
...
Yes, if you define the You could disable the What is exactly your use case? You want to keep the
Generally, for Conan packages this is not a concern, Conan automatically manages these things, that is one of the purposes of Conan, it abstract away the location of the dependencies. |
Thanks for the detailed response! Our use case is an internal, consumer-only recipe, which we only use to download and configure the dependencies for our build. We use |
Then, for a consumer-only recipe, I think that the Thanks to you for the feedback! |
Describe the bug
We are experiencing a CMake installer issue while migrating our project to Conan 2.x on Linux. The existing CMake project works as expected with 1.x recipes and dependencies using generated conan_paths.cmake.
Using CMake 3.31.4 with Conan 2.12.2
However, on RHEL/Alma 8, the introduction of CMakeDeps and CMakeToolchain in 2.x results in the
GNUInstallDirs
variables being overridden with incorrect values in conan_toolchain.cmake:CMAKE_INSTALL_LIBDIR
gets set to 'lib' instead of 'lib64' andCMAKE_INSTALL_SBINDIR
gets set to 'bin' instead of 'sbin'.This is documented in CMakeToolchain under
output_dirs
.We tried the
tools.cmake.cmaketoolchain:extra_variables
workaround suggested in #16829, but the result seems to be the same. Also, I would rather not arbitrarily replace the values generated by GNUInstallDirs because then we also have to incorporate that change into the developer environment, possibly for multiple platforms.Is it possible to use ONLY the defaults generated by GNUInstallDirs? How to prevent this override?
Referencing existing issues:
#14733
#16829
How to reproduce it
No response
The text was updated successfully, but these errors were encountered: