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.
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.
Look for a setting where you can configure the path of Cmake on your system (maybe /usr/bin/cmake).
Clion hasn't found cmake executable
- 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 - second case cmake is install then go to (1.2)
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
© 2022 - 2024 — McMap. All rights reserved.