CMake version in CLion not updating

Viewed 9669

I cloned a project from my teacher, and I wanted to run it on CLion. However, I noticed an error:

CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.14 or higher is required. You are running version 3.13.2

I configured a new CMake debugger in CLion, but I still keep getting the error.

enter image description here

I have a new version of CMake installed:

enter image description here

When I install a new CMake version in cygwin, CLion returns this: enter image description here

enter image description here

Does anyone know what I am missing or doing wrong?

2 Answers

It sounds like you want CLion to use your newest version of CMake (instead of the bundled 3.13.2 version). To do that, you must add a new Toolchain (see here) or modify an existing one (see here):

  1. On Windows CLion, navigate to File > Settings > Build, Execution, Deployment > Toolchains, and choose the toolchain you want to modify.
  2. At the CMake: section, select a custom CMake installation by choosing the path to your custom CMake executable (likely a bin folder).
  3. Click OK to save your changes.

Eventually, I solved the problem by installing a new version of CMake inside the cygwin installer. I also updated CLion, because I had the 2018 version and that version only supports CMake versions up to and including 3.13. After updating CLion to the 2019 version, it supported CMake versions up to and including 3.15. Because the CMake version 3.16 is pretty recently released. CLion automatically takes the maximum supported version, which in this case is the 3.15. The minimum version in de CMakeLists.txt was 3.14, so 3.15 worked fine.

Related