CLion 2024.1 Help

Change project root

When you open a project, CLion treats the location of the top-level configuration file as project root. Also, in the case of CMake, when you create a new CMake project, CLion places the CMakeLists.txt file under the root.

However, your project may have a different structure. For example, your main project configuration script (CMakeLists.txt or other) can be located in some subdirectory. In this case, you need to change the project root manually.

  1. Select Tools | <project format> | Change Project Root from the main menu.

    <project format> is either CMake, Makefile, or Compilation database.

  2. Point CLion to the directory that you want to be considered as root.

  3. Make sure to reload the project.

Last modified: 11 February 2024