Reload CMake Project overwriting ./Makefile

I am using CMakeLists.txt solely to let CLion know about sources. I also have a Makefile which I use for actual building from the command line.

At some point for one of my projects (project1) the default CMake profile (Debug) was lost (perhaps in one of the EAP versions). This resulted in Find Usages no longer working.

To fix this I created a new CMake profile (see screenshot below). It's an empty profile with all defaults.

This fixed Find Usages. But when I run "Reload CMake Project" it now overwrites my custom ./Makefile.

In another project (project2) with the default CMake profile (matches same screenshot). When I run "Reload CMake Project" it doesn't overwrite the ./Makefile. 

I'm missing why the default CMake profile in project2 does not overwrite ./Makefile while the empty CMake profile in project2 does. Is there some way to get back to the default in project1? Just hitting Reset in the upper corner removed the Debug profile - which breaks Find Usages again.




CLion 2019.3.1
Build #CL-193.5233.144, built on December 6, 2019
Runtime version: 11.0.4+10-b520.11 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.2.17-1rodete3-amd64
GC: ParNew, ConcurrentMarkSweep
Memory: 16371M
Cores: 72
Registry: run.processes.with.pty=TRUE, cidr.max.intellisense.file.length=2670746, cidr.indexer.thread.count=-10
Non-Bundled Plugins: AceJump, BashSupport, GrepConsole, IdeaVIM, PlantUML integration, Shell Process, String Manipulation, com.andrewbrookins.wrap_to_column, com.dubreuia, com.intellij.plugins.html.instantEditing, com.jetbrains.php.framework, com.mathewcasperson.intellij.doublebufferswitch, com.vladsch.idea.multimarkdown, fuchsia.developer.plugin.fidl, io.sourcetrail.idea, izhangzhihao.rainbow.brackets, krasa.CpuUsageIndicator, name.kropp.intellij.makefile,



FYI, I seem to have resolved this, but I am not sure what did the trick. It may have been deleting the existing ./cmake-build-debug directory.


Hi Dave!

It's better to work with Makefiles projects in CLion using Compilation Database - Isn't it more convenient for you?


Please sign in to leave a comment.