Use a modifiable user-preset sample for VS 2022/2019#97
Conversation
|
issues
I would suggest to add the trick of copying this file automatically as part of the cache generation. That works really well and the user will actually have a good default instead of a broken project configuration in VS when initially opening it. |
06fd452 to
43fb8b0
Compare
implemented 2 and 3 as for 4, if you pass cmake a variable and don't use it, he will pop out a scary message of how "such and such were not used in the project" which I'd rather avoid. in my testing, VS didn't even notice the json is invalid, and while clion does complain, it recognizes the presets and it works fine. last suggestion is good and I tried it, problem is, vs2019 ships with cmake 3.20 which doesn't have |
--
regarding the file copy, there are many ways to copy files in cmake, the older ones are available since almost the first v3 of cmake, I'll check |
Customizing a repo-tracked preset file doesn't work: Type in your gamedir for debugging, or toggle verbose mode for the build, or configure Chinese UB MapEditor: you now have an unstaged `CMakePresets.json` change in your working directory. very annoying. Also, Visual Studio 2022's preset support has a bug: if you have a `CMakePresets.json` file, no matter in which file (user or repo) the preset you have selected is defined, if you click "Manage Configurations..." it will always open `CMakePresets.json` for editing, setting the user up for failure and editing the commited-to-repository file. Having just the `CMakeUserPresets.json` file also sidesteps another poor Visual Studio 2022 decision: hiding in Folder View files that are .gitignore'd (like `CMakeUserPresets.json`). In the absence of a `CMakePresets.json` file, selecting "Manage Configurations..." will open the right file for editing. The workflow is then: Copy `CMakeUserPresets.json.sample` into `CMakeUserPresets.json` _once_, then customize that to your heart's content without git bothering you and accidentally adding an unwanted change to a patch. Or make your own.
move function out of root cmakelists.txt file move user preset template to a presets directory this is horrible and I hate it
38ed64e to
a6b568b
Compare
Customizing a repo-tracked preset file doesn't work:
Type in your gamedir for debugging, or toggle verbose mode for the build, or configure Chinese UB MapEditor: you now have an unstaged
CMakePresets.jsonchange in your working directory. very annoying.Also, Visual Studio 2022's preset support has a bug: if you have a
CMakePresets.jsonfile, no matter in which file (user or repo) the preset you have selected is defined, if you click "Manage Configurations..." it will always openCMakePresets.jsonfor editing, setting the user up for failure and editing the commited-to-repository file.Having just the
CMakeUserPresets.jsonfile also sidesteps another poor Visual Studio 2022 decision: hiding in Folder View files that are .gitignore'd (likeCMakeUserPresets.json).In the absence of a
CMakePresets.jsonfile, selecting "Manage Configurations..." will open the right file for editing.The workflow is then:
Copy
CMakeUserPresets.json.sampleintoCMakeUserPresets.jsononce, then customize that to your heart's content without git bothering you and accidentally adding an unwanted change to a patch. Or make your own.