[question] Is modifying properties of a dependency allowed/supported? Where should it be done?
See original GitHub issueI’m creating conan recipes for external projects. So it would be nice to avoid patches where I can.
A certain project I’m packaging uses names for the CMake modules that are different then conan’s default.
It uses jansson
as a dependency, which does not set a certain cmake_file_name
.
Because of this, conan will generate janssonConfig.cmake
, generating the jansson::jansson
target.
But the projects expect JanssonConfig.cmake
, creating Jansson::Jansson
(the project contains a FindJansson.cmake
module.
In the recipe, I can fix this by donig:
def generate(self):
if self.options.with_jansson:
self.dependencies["jansson"].cpp_info.set_property("cmake_file_name", "Jansson")
self.dependencies["jansson"].cpp_info.set_property("cmake_target_name", "Jansson::Jansson")
self.dependencies["jansson"].cpp_info.set_property("cmake_module_file_name", "Jansson")
self.dependencies["jansson"].cpp_info.set_property("cmake_module_target_name", "Jansson::Jansson")
deps = CMakeDeps(self)
deps.generate()
But it’s not clear to me whether this is allowed by conan. Also, I hope this modification of the jansson properties remain local to my recipe, and won’t bubble out to dependencies.
- I’ve read the CONTRIBUTING guide.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
How to modify the properties file import by Maven
I add a dependency in Maven, And there is properties file in that dependency , I need to modify the file, How? ......
Read more >Frequently Asked Technical Questions - Apache Maven
How to find dependencies on public Maven repositories? Why is my Javadoc JAR built twice during release? How do I prevent "[WARNING] Using ......
Read more >Overriding Dependency Versions with Spring Boot
The Problem. We have a parent pom that has dependency management for Reactor (2.0.7). It does this via a Maven property, i.e. in ......
Read more >Transforming dependency artifacts on resolution
When the dependency does not have a variant with the requested attributes, resolving the configuration fails. Sometimes it is possible to transform the ......
Read more >Question concerning portal dependency jars - Forums - Liferay
No. So when you declare a dependency in the pom w/o the provided scope, when maven builds the war it will include the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, then I think we can close this question, responded as no, modifying dependencies information is not allowed, and we can spin a new ticket for this CMakeDeps configuration
Yes, applying the changes to
CMakeDeps
makes more sense. As we want to only change the output files ofCMakeDeps
, and not the dependency tree.