-
Notifications
You must be signed in to change notification settings - Fork 66
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
cmake: add CMakePresets with defaults relevant for building CXX-Qt #325
Conversation
9fd588e
to
7038ab3
Compare
Seems Windows might need the |
7038ab3
to
98bc91c
Compare
This allows us to have presets for building with Qt 5, specifying recommended generators, caching tools, and showing output on failure of tests.
98bc91c
to
57e316e
Compare
I don't understand the point of having presets when there's a preset for every combination of options. Why not just specify the CMake options that already exist? |
Right maybe we don't need all the options but just the main few. But it's still release yes/no, Qt5 yes/no, and vcpkg yes/no, then assume they have ninja and sscache (which removes one set from the matrix). Note that the CMakePresets are useful for IDEs like vscode as the CMake plugin there uses the presets to decide how to build and setting the options manually is kinda a pain. And other KDAB projects have various combinations in the CMakePresets https://github.com/KDAB/KDDockWidgets/blob/1.7/CMakePresets.json :-) And putting some of the options into presets means that developers don't have to hunt around README/CMakeLists.txt finding which options are available, as described in the blog https://www.kdab.com/the-power-of-cmake-presets/ |
That sounds like a VSCode problem. :) I don't have any use for these because I build in a shell, so I don't really mind what you do with these. @LeonMatthesKDAB, thoughts? |
Hehe :-) I can keep them as CMakeUserPresets just didn't know if they were useful upstream. Also CI could use them and when building from the CLI they could be used rather than multiple flags. Or the matrix could be reduced so there are only some options :-) |
"configuration": "Release", | ||
"hidden": true | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do use this we likely also want to set the parallel / execution jobs to something larger than 1
"execution": {
"jobs": 2
},
Going to close this for now as there are too many combinations to push into the repo. |
This allows us to have presets for building with Qt 5, specifying recommended generators, caching tools, and showing output on failure of tests.