question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] Is modifying properties of a dependency allowed/supported? Where should it be done?

See original GitHub issue

I’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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
memshardedcommented, Oct 21, 2022

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

0reactions
madebrcommented, Oct 21, 2022

Yes, applying the changes to CMakeDeps makes more sense. As we want to only change the output files of CMakeDeps, and not the dependency tree.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found