"cmake project is not loaded" message when using compilation database


I am using the new compilation database integration. It is working well so far except for one recent problem. I am getting a "CMake project is not loaded" message that asks me to "Select CMakeLists.txt file..." (pic below). But since I am using a  compilation database I would think I don't want a CMakeLists.txt file.


I found that I had a CMake Debug profile and deleted it (see 2nd pic), but I am still getting the warning. 





I added an empty CMakeLists.txt file which seems to have removed the error. Still wondering what CMakeLists.txt means in context of complication database.


Hi Dave,


It's not proper bahaviour. You should never see this warning. Could you please remove empty CMakeLists.txt, invalidate caches and restart (File | Invalidate Caches/Restart ...) CLion and wait until project load. Does you see the same problem?  


Thanks. That seemed to fix it.

As background, this was an existing project that I wanted to convert to using compilation database instead. With the existing CMake-based project I wasn't able to Open compilation database files. It just didn't recognize them. So I deleted the CLion setup and recreated it using the following steps.

  • Close project
  • Delete project in CLion
  • In project dir delete .idea, CMakeLists.tx, and cmake-build-debug.
  • Then follow steps for opening a compilation database

Optimally, I would have liked to be able to open a compilation database from inside the project and have it move from CMake to compilation database (perhaps after a verification prompt).


HI David,


You could move compilation database json file to separate directory (e.g <cmake_root_directory>/compilation_database/compilation_database.json>) and then change project root (Tools| Compilation Database | Change Project Root) to <cmake_root_directory>. Then CLion creates .idea catalog inside <cmake_root_directory>/compilation_database and you could fast switch between cmake and compilation database projects.


Thanks for the tip. In my case I just wanted to switch and existing project to compilation database. I don't need cmake at all with compilation database support (which is very exciting).


Note, I am seeing the"CMake project is not loaded"  error again in a new project. Using "File | Invalidate Caches/Restart ..." did not solve the problem. I ended up creating having to create an empty CMakeLists.txt to get rid of the error.

A few folks at my company are seeing this. Let me know if you want me to share logs with you somehow to help troubleshoot.


David, what CLion version do you use? Is the problem reproducible in CLion 2018.3 EAP (if you open a compilation database project which doesn't contain any CMake-related files)?


I am also seeing this when I use CLion with a non-CMake project.  I still see it after updating to version 2018.3:

CLion 2018.3
Build #CL-183.4284.156, built on November 23, 2018
JRE: 1.8.0_152-release-1343-b15 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.1


@Jnross, do you mean compilation database projects? Or Gradle projects? Or something else?


I have a project which contains both C and Rust code and uses a custom cargo and Makefile based build system.  There are no CMake artifacts anywhere in my project.


I'm using CLion because it has good plugins for Rust and other languages, and provides better editing and debugging support than any other IDE I have used.  But that nagging banner always at the top of the editor is rather annoying.


The thing is CLion now supports CMake, Gradle, Compilation Database and Cargo projects (the last ones via the Rust plugin). When a project uses some other build system (like custom build system in your case), the "CMake project is not loaded" warning is shown. 

Please describe your case and opinion in the comments to https://youtrack.jetbrains.com/issue/CPP-14062.


I am having this problem right now and so far nothing from above helps.


Ramin could you please create a ticket in the our tracker so we could investigate the issue?


I ended up moving my project from windows into an Ubuntu VM to avoid the problem as I am short on time.


Please sign in to leave a comment.