-
Notifications
You must be signed in to change notification settings - Fork 991
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] Settings CMake option for consumed package in conanfile.py #17541
Comments
It is not possible to directly inject a CMake variable from a consumer recipe into a dependency. The recommended way to implement this is having the dependency recipe to properly define an What you can do instead is defining it in the profile file. This is the recommended way, configuration of dependencies is typically better in profile files, even For injecting a CMake variable, you can use the:
So defining it in your You might also inject a full toolchain file with Please let me know if this helps. |
I'm using
I can see it picked it up in my CMake output when running CMake configure here:
However |
Yes, this is the way to go. They don't need to modify their default profiles, users don't have do do much.
That would be a different thing to check, and it would need some extra details:
|
Woot! Got it working, thanks for your help @memsharded. The issue I was seeing with:
Was likely due to the fact that I was setting it using....
... but then it was being overwritten by the default Conan options for the GDAL recipe. I was just testing out the ability to directly set CMake variables from a host profile. Unfortunately I picked a bad variable to test with and confused myself. This is what I ended up using for my host profile with success:
To load the profile when using This gets me by for now.
I'll create a ticket to get |
What is your question?
I would like to set a CMake option for a package that I'm consuming in my conanfile.py. To be specific I need to set
GDAL_ENABLE_DRIVER_PDS=OFF
for GDAL. The Conan recipe supports many options but not the ability to disable this specific option. Here is an example of what I'm trying to do...Is this possible to do with Conan or do I need to manually build this library to have control of this CMake option?
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: