I have imported a CMake project into Eclipse CDT following the instructions in this question, specifically this answer.
This works well unless I make changes to the makefiles – they will not be picked up automatically. The file in question was Makefile.am, which is used for custom build commands to convert SVG files into PNG files of predefined size. I had added a few svgs += blah.svg
lines.
Re-running the cmake command in the original answer fixed things.
I tried to automate this step by creating a custom builder that would run cmake at the start of each build. This worked well on a test run, but after cleaning the project once, my custom builder is gone. Moerover, when I try to recreate it (with the same name), I get the error message
A 'Program' configuration with this name already exists
Why does the custom builder get deleted? Why is it still lurking around somewhere (resulting in the name still appearing to be in use)? What can I do about it?
UPDATE:
Closer investigation (using git to track changes to the workspace) revealed the following:
- The custom builder definition is stored in a file in
project_dir/.externalToolsBuilders/builder_name.launch
, whereproject_dir
is the project directory andbuilder_name
is the name of the custom builder. - A reference to the custom builder is added to
project_dir/.project
. - Cleaning leaves the
.launch
file but removes the entry in.project
.
This explains the behavior: without the entry in .project
, the custom builder will not show in the Builders dialog and not run as is it no longer associated with the project. But since the file for the builder definition still exists, Eclipse cannot add another builder of the same name.
The culprit is thus clearly Eclipse, not cmake, as the changes occur outside of the directory structure which cmake would touch.
The question then is: how can I prevent Eclipse from messing with my custom builders on clean?