CLion 2020.3 Help

Load/reload CMake

Load CMake

  • If you open a project in CLion, but no CMakeLists.txt file is detected under the project root, you will be prompted to create it or associate your project with with an existing CMakeLists.txt file:

    Create or select CMakeLists.txt

  • If you already have a CMakeLists.txt file ready to be loaded, use the Select CMakeLists.txt action, or right-click the file in the project tree and select Load CMake Project from the context menu:

    Loading an existing CMakeLists.txt file

Reload CMake

When you make changes in the CMakeLists.txt file, CLion prompts you to reload the project.

CMake reload options

There are two options for project reload:

  • Reload changes - in this case, you reload the project once, and all the subsequent changes in CMakeLists.txt will also require reloading.

  • Enable Auto-reload - this option lets CLion silently reload the project on every change in your CMakeLists.txt. This is similar to selecting the Reload CMake project on editing CMakeLists.txt checkbox in Settings / Preferences | Build, Execution, Deployment | CMake:

    Enabling auto-reload in CMake settings

Note that your project is reloaded automatically when you reset the CMake cache.

To reload a project manually when needed, use one of the following options:

  • Call Find Action ( Ctrl+Shift+A ) and start typing reload cmake. Select the icons.actions.refresh.svg Reload CMake Project action.

  • On the main menu, select File | icons.actions.refresh.svg Reload CMake Project or Tools | CMake | icons.actions.refresh.svg Reload CMake Project.

  • In CMake tool window, click icons.actions.refresh.svg.

Stop project reload

To stop the process of reloading a project, use one of the following options:

  1. Call Find Action ( Ctrl+Shift+A ) and start typing stop cmake. Select the Stop CMake Project Reload action.

  2. In CMake tool window, click

Manage Run/Debug configurations on project reload

When you add or delete targets and reload your project, CLion automatically creates or deletes the corresponding Run/Debug configurations. You can control this behavior in the settings of the configuration templates:

create or delete configurations automatically

    Unload CMake

    Use the Unload CMake Project action when you need to unlink your project off the CMake build system completely or when CLion loads a CMakeLists.txt script, but you want to use another one for your project.

    • Call Tools | CMake | Unload CMake Project from the main menu.
      the unload cmake option in the main menu

      Upon this action, your project's state is as described in Load CMake.

    Last modified: 21 September 2020