less than 1 minute read

CMake can group settings together via presets.

Usage: $ cmake --presets=<PRESET>
autocomplete with <tab> key

See $<ROOT>/CMakePresets.json for implementation details

Define user specific settings in $<ROOT>/CMakeUserPresets.json

Example:

// CMakeUserPresets.json
{
    "version": 3,
    "configurePresets": [
        {
            "name": "myPreset",
            "description": "My own Preset",
            "hidden": false,
            "inherits": [
                "linux-clang-base",
                "ninja",
                "_debug"
            ],
            "cacheVariables": {
                "CMAKE_CXX_STANDARD": "20",
                "QL_USE_STD_SHARED_PTR": "ON",
                "QL_USE_STD_ANY": "ON",
                "QL_USE_STD_OPTIONAL": "ON",
                "QL_USE_STD_FUNCTION": "ON",
                "QL_USE_STD_TUPLE": "ON",
                "QL_COMPILE_WARNING_AS_ERROR": "ON"
            }
        }
    ]
}

Categories:

Updated: