Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
CMake 3.19 was officially released a couple of months ago, and one of the biggest – and most exciting – new features is the addition of presets. What are presets, you might ask, and why should we be excited about them?
Presets are a bunch of pre-set CMake options that enable developers to ensure that multiple configurations remain consistent, even when using different compiler tool chains, inserting different debugger or profiler options, or building selected packages within a project. Essentially, you put definitions of the CMake options you want into one of two JSON files: one associated with the project, and one for the user.
While this sounds like a bit of a trivial feature, it’s becoming more and more common to see several arguments needing to be passed to CMake to configure different combinations. A preset combination then simplifies and makes builds less error-prone while opening up several really powerful use cases.
We’ve been using presets for our kddockwidgets project very successfully – look there for an example of a CMake preset file in action.
For more information about KDDockWidgets and to see a demo, visit our KDDockWidgets webpage.
Kevin Funk's whitepaper on CMake for Qt might be of interest to you as well, especially if you're still only considering moving to Qt 6.
About KDAB
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications. In addition to being leading experts in Qt, C++ and 3D technologies for over two decades, KDAB provides deep expertise across the stack, including Linux, Rust and modern UI frameworks. With 100+ employees from 20 countries and offices in Sweden, Germany, USA, France and UK, we serve clients around the world.
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Learn Modern C++
Our hands-on Modern C++ training courses are designed to quickly familiarize newcomers with the language. They also update professional C++ developers on the latest changes in the language and standard library introduced in recent C++ editions.
Learn more
1 Comment
27 - Jan - 2021
Sys
Thanks.