-
Notifications
You must be signed in to change notification settings - Fork 993
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
CMakeDeps: no more modification of CMAKE_MODULE_PATH
/CMAKE_PREFIX_PATH
#12229
Conversation
CMAKE_MODULE_PATH
/CMAKE_PREFIX_PATH
Hi @SpaceIm - thanks for your contribution. I'm looking into this and trying to understand in which scenarios this is a problem. I have a feeling that if these lines were to be removed, we would be impacting the functionality of This:
will result result in something like:
and the variable When we have this situation:
The So I would imagine that for
What should happen otherwise is that the
where Is there a chance that the issue is not with |
Why?
You mean "unless Anyway, try conan-io/conan-center-index@9569dbf with conan 1.52.0, 2 profiles, and cross-build with different arch, you'll see that
Unrelated
No, it's an issue with CMakeDeps. CMakeToolchain is fine I think, I've made the PR allowing to properly find executables of build context with |
Hi @SpaceIm - I see what you mean, I can reproduce this and can see how the files generated by I have opened an issue for us to track this: #12237 - as first we'd like to make sure that removing this does not impact existing functionality. It may as well be that this PR fixes the issue without any negative consequences - however, we would typically include a functional test that minimally reproduces the issue, fails on |
I agree. I'll do when I have time (probably not this week). |
@jcar87 I've updated one of the functional test, this test fails without the fix in this PR. Maybe it should be a dedicated integration test instead since it tests an interaction between (by the way |
Thanks for the contribution, closing this in favor of #12464 that implements part of these changes. |
Changelog: (Fix): Remove
CMAKE_MODULE_PATH
/CMAKE_PREFIX_PATH
modification in files generated byCMakeDeps
Docs: https://github.com/conan-io/docs/pull/XXXX
closes #12237
Basically these modifications of
CMAKE_MODULE_PATH
/CMAKE_PREFIX_PATH
inCMakeDeps
can defeat the logic ofCMakeToolchain
implemented in #10186.For example: conan-io/conan-center-index#13269 (comment)
It means that if:
foo
requires
&tool_requires
CMakeToolchain
&CMakeDeps
, and hasfind_package(recipeA)
beforefind_program(FOO NAMES foo)
then,
find_program()
will find executablefoo
from recipeA "requires" package instead of recipeA "tool_requires" package.So this PR removes this side effect.
Anyway it's not the responsibility of a config file to modify these variables (canonical files generated by a
install(EXPORT ...)
command don't do that).develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.