Skip to content
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] How to disable CMake targets or pkg-config files without dummy "do_not_use" targets? #17815

Open
1 task done
tttapa opened this issue Feb 19, 2025 · 3 comments · May be fixed by #17817
Open
1 task done

[question] How to disable CMake targets or pkg-config files without dummy "do_not_use" targets? #17815

tttapa opened this issue Feb 19, 2025 · 3 comments · May be fixed by #17817
Assignees

Comments

@tttapa
Copy link

tttapa commented Feb 19, 2025

What is your question?

Hi, I noticed that several packages in the Conan Center Index expose "dummy" targets or pkg-config files with names that include things like "do_not_use". For example, openmpi, hdf5 and pybind11.

This leads to rather confusing recommendations on the Conan Center page :)

Image

Is there any way to avoid these "dummy" targets?

Here's a quick list of packages that have "do-not-use" in their cppinfo:
https://github.com/search?q=do-not-use+OR+do_not_use+repo%3Aconan-io%2Fconan-center-index+language%3APython&type=code&ref=advsearch
And here's a related issue about accidentally linking to pybind11_all_do_not_use: conan-io/conan-center-index#25685

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Feb 19, 2025
@memsharded memsharded linked a pull request Feb 19, 2025 that will close this issue
@memsharded
Copy link
Member

Hi @tttapa

Thanks for your question.

I am doing a PR with some tests here: #17817, to understand better if this was just legacy for Conan 1, but it seems this is still necessary to be able to control the creation of the expected .pc files from components.

But it also seems that it might not be necessary in some of those cases. Need to check this with the team.

@valgur
Copy link
Contributor

valgur commented Feb 20, 2025

Allowing None for self.cpp_info.set_target_property("pkg_config_name", None) would be one obvious solution here, in a sense, but since this will break all consuming recipes that don't specify self.cpp_info.requires or use the aggregate target anyway, I think that by far the best solution would be a way to mark one of the components as the default one to be used instead of the aggregate one.

What do you think, @memsharded?

@memsharded
Copy link
Member

This PR is to explore these possibilities, yes.
It might be challenging to do without breaking indeed, so we will see, but lets try to have a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants