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 Tools | <project format> | Change Project Root from the main menu.
<project format> is either CMake, Makefile, or Compilation database.
Point CLion to the directory that you want to be considered as root.
Make sure to reload the project.
note
Change Project Root does not affect the actual location of your files.
Our website uses some cookies and records your IP address for the purposes of accessibility, security, and managing your access to the telecommunication network. You can disable data collection and cookies by changing your browser settings, but it may affect how this website functions. Learn more.
With your consent, JetBrains may also use cookies and your IP address to collect individual statistics and provide you with personalized offers and ads subject to the Privacy Notice and the Terms of Use. JetBrains may use third-party services for this purpose. You can adjust or withdraw your consent at any time by visiting the Opt-Out page.