Using CLion with Makefile projects


I am attempting to get CLion to work with previous Makefile projects.  I was able to get one of them to work, but it took over 2 days (on and off) and I really have no clue exactly what all the steps I took were.  Been really happy with the tool so far.

So, I tried opening a second project, and am making no headway.  The steps I have taken are:

From the flash screen: select Open, select the Makefile, select open as file

Select Makefile in the 'Makefile' project (I assume it is a project name, but why not the directory name?).

File -> load makefile project

I now have another Makefile showing in the list.  The first is in my project directory, the second is /tmp/Makefile.  What is this for?

Select the project directory.

Settings -> build, execution, deployment -> Makefile, and change build directory to '.' (not building into 'build'), and change build target to 'all' (not 'check').  OK

Build -> rebuild project will now rebuild the project.

File -> Close Project.

It now looks like I have a project named Makefile, living in /tmp/Makefile.


The first project I worked with I managed to get to show up with the actual project directory name, and I seem to be able to get into / out of the project with no problems.  What am I doing wrong with this one?  Something is obviously not right, but I have no clue where to go.  Is there a document somewhere that covers this?  I have found this:, but it is not really helping much.

Any help appreciated.

Comment actions Permalink

I just remembered:  Build #CL-221.5591.52, built on May 10, 2022

And if I try the other mechanism to open a Makefile project:

Open (from splash screen), select Makefile, open as project...

I never get a request for a 'make clean', but I do get an error:  CMakeLists.txt not found

So I don't get as far using what I figured was the more simple process.

Comment actions Permalink


The proper way is to select "Open as Project", see 

Please do the following: `File | Close Project`, remove all the .idea subfolders from the project folder, remove the cmake-build-debug subfolder if you have it, then on CLion Welcome Screen select `Open` > select the top-level Makefile > select "Open as Project".

Comment actions Permalink

Thank you.  I was missing the .idea directory.  I had chased down stuff related to this project in the .cache and the .config directories, but could not see .idea.  CLion was acting like it was keeping some data from previous attempts to open as a project, but I couldn't find where. 

Note:  I was using the open -> Makefile -> "open as project" at the beginning, but never got a request to do a 'make clean', and CLion kept acting like it thought it was a cmake project.  So tried the other process (also documented out there on the website), and was going back and forth trying to figure out what I was missing.

Again, Thanks.

Comment actions Permalink

Did it worked this time (after deleting the .idea folder and reopening the project)?


Please sign in to leave a comment.