Override CMake settings for a project

To override CMake settings for the current project:

  1. Go to Projects > Project Settings > CMake.

    {CMake settings for a project}

  2. Clear Use global settings.
  3. Configure CMake for the project.

Your choices override the values you set in Preferences > CMake > General.

SettingValueRead More
Autorun CMakeRuns CMake to refresh project information when you edit a CMakeLists.txt configuration file in a project. Also, refreshes project information when you build the project.View CMake project contents
Package manager auto setupSets up the Conan or vcpkg package manager for use with CMake.Using CMake with Package Managers
Ask before re-configuring with initial parametersAsks before acting when you select Re-configure with Initial Variables.Re-configuring with Initial Variables
Ask before reloading CMake presetsAsks before acting when you select Build > Reload CMake Presets.CMake Presets
Show subfolders inside source group foldersHides subfolder names and arranges the files according to their source group in the Projects view.Hide subfolder names in Projects view
Show advanced options by defaultShows all CMake variables by default in Initial Configuration and Current Configuration.Viewing Advanced Variables
Use junctions for CMake configuration and build operationsOn Windows, uses junction points for CMake configure, build, and install operations.Using Junction Points on Windows

You can set these preferences as CMake presets or in a CMakeLists.txt.shared file.

See also How To: Build with CMake, CMake, and Configuring Projects.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.