I'm having issues with Clion (1.0.1) and CMakeLists.txt.
I use GitHub for my projects, and I commit them from directly within the IDE. If I then checkout the project on a different computer, the IDE looks for CMakeLists.txt in the original PC's directory.
The specific error message reported by Clion is this:
Error: CmakeLists.txt not found in C:\Users\Chris\ClionProjects\SDLTestClion
However, this is a Linux machine, so there's obviously no C drive.
Here's what I've tried:
I can't find anything else, so either I'm missing something or this is bugged in version 1.0.1 and I need to sift through project files to change the path that Clion looks for the CMakeLists.txt file.
To open a project, you can point CLion to the top-level CMakeLists. txt and choose Open as Project. You can edit CMakeLists. txt files right in the Editor.
Running CMake for Windows / Microsoft Visual C++ (MSVC) Run cmake-gui.exe, which should be in your Start menu under Program Files, there may also be a shortcut on your desktop, or if you built from source, it will be in the build directory. A GUI will appear similar to what is shown below.
In Qt Creator, go to File → Open File or Project… and choose CMakeLists. txt from the source folder you want to build. Qt Creator will prompt you for the location of the binary folder, calling it the “build directory”. By default, it suggests a path adjacent to the source folder.
Well, I found the issue. As far as I can tell, in version 1.0.1 there is no way to remedy the problem through the IDE.
Solution:
projectDir/.idea
misc.xml
PROJECT_DIR
to point to the directory with the project's CMakeLists.txt
.I think this is a bug and this field should probably be updated when choosing a new project root. A temporary solution may be to add misc.xml
to .gitignore
but I haven't tested this and don't know if this will cause other problems or if the IDE will automatically regenerate the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With