CLion constantly reloads CMakeProject
Hi!
I have a problem with CLion such that it constantly reloads the particular project without finishing the task. The log in the CLion console says the following:
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/c++
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
But this output appears in a constant loop. I do not know how to fix this. Previously, the project started up fine, but now it doesn't seem to work. Other projects however work well. Does anyone have an idea what the problem could be? In order to give you more insight what information should I share in the forum?
Thank you very much and kind regards!
Please sign in to leave a comment.
1. Could you please clear your CMakeCache.txt manually and try again?
2. Pass -DCMAKE_CXX_COMPILER=/usr/bin/c++ explicitly to CMake options
I was seeing exactly the same thing, except that my compiler path is different. I was on 2017.3.3 (but it does the same thing in 2018.1), and everything was working just fine. The first thing I noticed is that Run/Debug configuration drop-down was showing "hc | Nothing to run on". Digging around a bit I ended up at the CMake console where I saw that all CMake configurations were in this endless loop.
I erased all the output directories (so no CMakeCache.txt file around). That didn't help.
It turns out I had modified the cmake settings (under "Build, Execution, Deployment") to use a different toolchain. As a result, the -DCMAKE_CXX_COMPILER flag was passed to cmake, which was also setting it unconditionally in one of the files included by CMakeLists.txt. Once I took the flag out, the endless loop stopped.
Hope it helps someone.