Skip to content

JetBrains IDE Issues

CLion C++ IDE

CMake Targets NOT Automatically Listed

Sometimes it happens that the dropdown list will not show the updated CMake targets in the dropdown list for target selection. Instead of adding them manually the solution is to remove entries in the file <project-dir>/.idea/workspace.xml.
The XPath for this is as follows.

//project/component[@name="CMakeRunConfigurationManager"]/generated/config

The problem is that this config list is keeping track of which projects are already taken over from the CMake-project. Probably not to overwrite changes to configurations made in the CLion IDE.

To list or modify XML-files from the Linux command line use the command xmlstarlet and install it using the next command.

sudo apt install xmlstarlet

To list the generated configurations use the following command in the project directory.

xmlstarlet sel --template --value-of '//project/component[@name="CMakeRunConfigurationManager"]/generated/config/@targetName' .idea/workspace.xml

To delete all the entries and let CLion import them again use the following command in the project directory.

The project should not be opened by CLion.

xmlstarlet ed --inplace --delete  "//project/component[@name='CMakeRunConfigurationManager']/generated/config" .idea/workspace.xml