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

Set CMP0142 policy in package templates #22692

Closed
wants to merge 1 commit into from

Conversation

Nekto89
Copy link
Contributor

@Nekto89 Nekto89 commented Feb 6, 2024

New behavior fixes warnings for Xcode generator in case of using CMake >= 3.25 and conan 2.

Without this policy CMake passes inexisting subdirectories to linker.
"ld: warning: directory not found for option '-L/Users/user/.conan2/p/b/expatbf806472793ba/p/lib/Release'"
https://cmake.org/cmake/help/latest/policy/CMP0142.html


New behavior fixes warnings for Xcode generator.
@uilianries
Copy link
Member

@Nekto89 Hello! Thank you for your suggestion. Have you talked to https://github.com/conan-io/conan/issues first? It sounds more a feature to be added in CMakeToolchain than a workaround to be added in CCI directly.

@uilianries uilianries self-assigned this Feb 6, 2024
@Nekto89
Copy link
Contributor Author

Nekto89 commented Feb 6, 2024

@Nekto89 Hello! Thank you for your suggestion. Have you talked to https://github.com/conan-io/conan/issues first? It sounds more a feature to be added in CMakeToolchain than a workaround to be added in CCI directly.

I did not. I've discovered that conan2 always adds lib directories to interface of cmake targets and there is no way to disable it. And CMake adds one more subdirectory for Xcode without this policy. I don't think that CMakeToolchain should control such CMake policies globally for user, because it may break some code.

@uilianries
Copy link
Member

@Nekto89 Let me check with Conan team, maybe are can find a way.

@valgur
Copy link
Contributor

valgur commented Mar 24, 2024

Yeah, this would make more sense as a policy set by Conan automatically, since the layout of the package directory is managed by Conan anyway.

Edit: On second thought, it might conflict with existing projects that rely on this deprecated feature.

@conan-center-bot conan-center-bot requested a review from AbrilRBS July 4, 2024 11:38
@Nekto89 Nekto89 closed this Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants