Clion "Cannot load CMake project: CMake executable is incorrect" issue
Asked Answered
A

5

5

I ran into a problem while trying to use Clion. I imported a project, yet all off the headers and .cpp files are greyed out. The error shown is as in the title: "Cannot load CMake project: CMake executable is incorrect".Here is a screenshot of it. It's worth noting that I'm working with kubuntu and have downloaded all of the following: gcc, g++, make, cmake, gdb. I would love some help with solving this problem so I could start working with Clion. Thanks in advance.

Actionable answered 1/12, 2016 at 23:34 Comment(0)
A
7

I just ran into this. Deleting the project's .idea directory and having clion recreate it fixed the issue for me.

Clion also reported that Bundled Cmake does not work in this enviroment

And when setting the actual path to the cmake binary it said it wasn't there when it was.

Averil answered 5/7, 2017 at 18:59 Comment(0)
L
2

make a c executable project. go to file->settings

enter image description here

Lhary answered 7/1, 2017 at 9:58 Comment(0)
Q
0

Look for a setting where you can configure the path of Cmake on your system (maybe /usr/bin/cmake).

Quinquepartite answered 2/12, 2016 at 0:3 Comment(0)
L
0

Clion hasn't found cmake executable

  1. first case cmake isn't installed :
    1.1. ubuntu : sudo apt-get install cmake
    1.2. Go to Settings->Build,Execution,Deployement-> Toolchains: set cmake executable to custom , and type : which cmake in your console set field right to custom to dir of cmake do same thing for gdb the apply
  2. second case cmake is install then go to (1.2)
Lobelia answered 2/4, 2018 at 11:41 Comment(0)
U
0

I am using WSL (wsl2 to be correct) and I had the same issue. Somehow CLion seems to have a problem with /usr/bin/cmake only being a link to the real cmake file. So to resolve this, follow each link till you hit the location of the executable

for windows users being new to linux: which cmake (most probably shows /usr/bin/cmake) cd /usr/bin/cmake ls -la | grep cmake (shows something like 20 Mar 26 09:54 cmake -> /opt/cmake/bin/cmake) do this till there is no link anymore pass this path to clion

I already added this as a bug: https://youtrack.jetbrains.com/issue/CPP-20644

Underhill answered 5/6, 2020 at 14:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.