[question] How to modify the build folder when using cmake_layout
What is your question?
Hello,
for cmake_layout the following is defined:
conanfile.folders.build:
- build: if the cmake generator is multi-configuration.
- build/Debug or build/Release: if the cmake generator is single-configuration, depending
I can remove the build prefix by adding this to global.conf tools.cmake.cmake_layout:build_folder=.
But i cannot remove the Debug/Release which is required in some uses cases.
What is desired is to have on Windows/Linux the same build folder path:
- C:\some\path\lib_debug\
- /some/path/lib_debug/
Thanks
Have you read the CONTRIBUTING guide?
- [x] I've read the CONTRIBUTING guide
Hi @ibrawada
Thanks for your question.
It is important to know about the specific generator, it doesn't make much sense to have lib_debug if you are using a multi-config generator, like Visual Studio in Windows or Ninja Multi-Config in any platform. Are you always using single-config generators in all platforms?
Yes, i know it makes litte sense to have lib_debug and lib_release folder for Visual Studio multi-config project.
We have VS for Windows and Make for Linux.
The reason why the paths have to be identical at some point is for the remaining evaluation of CI pipeline
The reason why the paths have to be identical at some point is for the remaining evaluation of CI pipeline
I am curious why. Why the folder cannot be just a parameter for the rest of the CI pipeline?
Or even better, why not automating it and abstracting that detail away? Like you can use a post_build hook that puts the built artifacts in a specific folder for the rest of the pipeline? (just as a quick example, I think there can be other different ways to approach this).
I am also not saying that this won't be possible, I am right now considering some changes in the cmake_layout in https://github.com/conan-io/conan/pull/17331 that could be a problem with this, or maybe we could consider some extra changes to allow this. So we need to understand well the use cases and flows. Because having exactly the same folder in Windows and Linux could be considered generally an anti-pattern, as these build systems behave differently in Multi-Config.
I am speaking for Ci devs here. The following steps are automated file paths replacements in logs to generate SonarQube issues aligned on both Linux and Windows. I guess the better way to solve it would be to use Ninja Multi Config on both platforms. The issue can be closed. Thanks
Thanks for the feedback @ibrawada
I am keeping this ticket open for a while, while I keep trying to work on https://github.com/conan-io/conan/pull/17331, I will mark this ticket to be closed automatically when that PR is merged, as it might improve the capabilities in this regard. Thanks!