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.
Select
from the main menu.Point CLion to the directory that you want to be considered as root.
Make sure to reload the project.
Last modified: 23 September 2023