-
Notifications
You must be signed in to change notification settings - Fork 1k
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] Consider passing the buildenv via CMake Presets #15012
Comments
To help aid in discussion, some good points about this topic were brought up here:
CMake Preset support was introduced in CMake 3.19, but Conan 2.x wants to target CMake 3.15. If I follow, this means that the Conan CMake build helper couldn't use |
Yes, the feature cannot be exclusive, in the sense that the integration relies on having CMake>=3.19 for all cases. The solution cannot be just using the |
I think Ryan was just nodding at the general principle that the CMake helper could do things its own way (e.g. conanbuild.sh), and remain compatible down to CMake 3.15, while the preset file carries the information to let an modern CMake using |
For this specific case, it seems like one would also want runenv (i.e. bindirs of requirments in profile:host) would also make it into a test preset, so that IDE features like a unit test runner can work with requires that had shared .dll (or .so) libraries in them. This again parallels the way the conan.tools.cmake helper overlays the runenv on top of the buildenv for |
#15192 has added |
What is your suggestion?
CMake presets allow setting the environment that is "activated" during the CMake run: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#id4
For example:
Currently, in Conan it is advised to 'activate' the run environment:
if we are able to gather the information and express it in the generated CMake presets by Conan, the workflow could be the same for all platforms:
and it would do TheRightThing ™️
this would narrow the gap of having to run different commands on Windows / macOS / Linux depending on whether the generator is multi-generator, without multigenerator, or whether we are using windows cmd prompt, powershell, or bash. Just some quality of life imprvement
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: