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
Adding CMakePresets.json for default Visual Studio configs #39
Adding CMakePresets.json for default Visual Studio configs #39
Conversation
Is this required for the CI run? I had deliberately left out the CMakeSettings.json file from the repository, since it contains user-specific settings, e.g. regarding building documentation etc. Also, I hate having the build directory inside the source tree, so my buildRoot and installRoot entries are different. I've also got a reference to the vcpkg toolchain file in there. Is there an argument for including it in the repository? |
It is not required for CI (hence separate PR). Having this file committed to repository will allow developers to select from 4 configurations - x86-Debug, x86-Release, x64-Debug, x64-Release - in Visual Studio without having to:
This is purely a convenience feature for Visual Studio P.S. Your point about personal settings being stored there is entirely valid, however. I think same level of convenience can be achieved by using |
1ee3f99
to
7a4b336
Compare
Added CMakePresets.json instead, see:
The idea behind this PR is to avoid having every developer setting up CMakeSettings.json for themselves (which might be tricky for some). Here's how it looks in Visual Studio: P.S. In some distant future, this will allow for Linux builds straight out of VS as well |
5337dd2
to
2a49909
Compare
@DarkWanderer Is is possible to configure the defaults to put the build directory default to be outside the source tree (or maybe just leave it blank?). If I understand @mschweiger correctly, the major concern with using defaults is that the build directory would be inside the source tree. Regarding the other concern, what about even just leaving the default fields blank? The way, developers would still need to fill in settings in before building. I understand that sort of defeats the purpose of the presets file in the first place, but this would still allow developers to have all four build configurations (x86 Debug, x86 Release, x64 Debug, x64 Release) all in the same solution, if I understand correctly -- which, to be honest, is the big thing that I like :). |
What is the issue with having build artifacts inside the source directory, given that it's ring-fenced (all items are in subdirectories of Perhaps I can document a way to place build/install directories to arbitrary location - so everyone can set it up to their liking - while retaining "least surprise" defaults? |
Let me rephrase this: I appreciate that this question is essentially matter of taste and do not claim that a particular way is unconditionally better. My suggestion comes from a standpoint that adding CMakePresets allows for new capabilities, while also helping to:
In my opinion, having a default of building within source directory is the "least friction" option, while capability to build outside of source dir is retained, for cases where it is a concern Of course, the decision is ultimately with you |
FWIW, I don't feel strongly about this either way, and I agree it's a matter of personal taste. I'm going to close this PR for now since @mschweiger prefers the build settings as they currently are and this PR has been open for 22 days. We can always reopen this in the future if this resurfaces. |
Allows to switch:
Without restarting Visual Studio / regenerating solution. (need to open directory, rather than solution file, in VS)