[CMake] cdt4 generator and adding new source files from inside eclipse

Eric Noulard eric.noulard at gmail.com
Thu Oct 27 08:20:29 EDT 2011


2011/10/27 Dan Kegel <dank at kegel.com>:
> On Wed, Oct 26, 2011 at 4:09 PM, Robert Dailey <rcdailey at gmail.com> wrote:
>> When you make any changes to any CMakeLists.txt, the Makefiles are setup to
>> check this and invoke cmake to reconfigure and regenerate those makefile
>> scripts. I only use Visual Studio generators, so I can't say exactly how it
>> works for Makefiles, but the principle is the same between the two.
>> Basically there is no need to run cmake directly after each edit. I only run
>> cmake once after a fresh checkout of my source code to get the initial
>> scripts, then after that I let it automatically detect changes and do the
>> respective work required to regenerate scripts/project files.
>
> That's great.
>
> I'm confused about one thing still: The cdt4 web page says
> "When you edit your CMakeLists.txt file, you are recommended to delete
> your project and reimport it."
> Why?

May be because unlike Visual Studio generator the
Eclipse generator is based on Makefile.
In particular, the eclipse project files are only an "interface" to
underlying Makefiles, i.e.
the makefiles are under CMake control not Eclipse's.

Does Eclipse support the fact that its project files (.project anc
.cproject) may
be modified from outside eclipse ? (or even concurrently when eclipse
is running?)

May be you could just try, and tell us the symptom ?

> If it's because cmake has generated a new .project / .cproject,
> does that mean you should do a build (or somehow otherwise trigger
> a cmake run) before deleting and reimporting the project?

Like I said (but I didn't tried) I'm not sure Eclipse has been
designed for external
and concurrent .project/.cproject file modifications.

May be you can dig this and teach us about it.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list