2

I have two CMake versions installed: one in /usr/bin/, the latest one in /opt/.

From the command line I can specify the latest version, and the C++17 code is compiled successfully.

From KDevelop, after setting the default CMake executable to /opt/cmake, the old version is still executed.

Is there anything else to set in KDevelop to let it find the new version?

Do I have to deal with KDevelop's plugins?

System:
Linux (Debian), KDevelop 5.2.1, CMake 3.7, CMake 3.10.2, Ninja

Pietro
  • 12,086
  • 26
  • 100
  • 193

2 Answers2

1

You can set the path to the CMake executable in both the global settings and the projects settings. Obviously new projects inherit the global setting but existing projects stick to their individual CMake path, even when the global setting is changed.

To change the project-specific CMake executable:

  1. open the project settings
  2. go to CMake tab
  3. click on "Show Advanced"
  4. change the "CMake executable" at the bottom
bjhend
  • 1,538
  • 11
  • 25
  • It seams, that the "CMake executable" configuration isn't applied in KDevelop 5.5.0 on ubuntu 20.04. – moudi Mar 08 '22 at 13:09
  • I'm using the latest KDevelop 5.6.1 as AppImage from [kdevelop.org](https://www.kdevelop.org) on Ubuntu 20.04, which works for me. – bjhend Mar 08 '22 at 13:37
  • Ok, I probably found the issue: The configuration isn't applied when the cmake binary isn't present in the given directory on the host computer. Unfortunately this is a issue when using a docker image including the toolchain! – moudi Mar 08 '22 at 14:08
0

Temporary fix:

cd /usr/bin
sudo mv ./cmake ./cmake-old
sudo mv ./cmake-gui ./cmake-old-gui
sudo ln -s /path/to/cmake ./cmake
sudo ln -s /path/to/cmake-gui ./cmake-gui

Of course, I would like to tell KDevelop to use the version of cmake I want.

Pietro
  • 12,086
  • 26
  • 100
  • 193