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

[feature] extend exporting binary directories to the cmake within CMAKE_PROGRAM_PATH for dependencies not having build context #17673

Open
1 task done
dpronin opened this issue Jan 30, 2025 · 1 comment
Assignees

Comments

@dpronin
Copy link

dpronin commented Jan 30, 2025

What is your suggestion?

Hi,
I've noticed that dependencies in non-build mode do not provide binary directories to the CMAKE_PROGRAM_PATH, there is code from conan:

# Read information from build context
        build_req = self._conanfile.dependencies.build.values()
        build_bin_paths = []
        for req in build_req:
            cppinfo = req.cpp_info.aggregated_components()
            build_paths.extend(cppinfo.builddirs)
            build_bin_paths.extend(cppinfo.bindirs)

I would like to know if it's been done intentionally or not

I have got the following case: I have got a library that exports libraries and includings placed in lib/ and include/ respectively and also have some binary that is installed in /bin and needed by those packages that depend on the being considered. I see that conan_toolchain.cmake does not contain /bin directory in CMAKE_PROGRAM_PATH of that library

Is it considered OK?

I would consider adding binary directories to the CMAKE_PROGRAM_PATH of all dependencies, is it considered harmful and dangerous by the community?

Thank you

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Jan 30, 2025
@memsharded
Copy link
Member

Hi @dpronin

Thanks for your suggestion.

This is already implemented this way in the new CMakeDeps incubating generator, see https://docs.conan.io/2/incubating.html

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

No branches or pull requests

2 participants