[CMake] cdt4 generator and adding new source files from inside eclipse
Robert Dailey
rcdailey at gmail.com
Wed Oct 26 19:09:11 EDT 2011
On Wed, Oct 26, 2011 at 4:42 PM, Dan Kegel <dank at kegel.com> wrote:
> I'm going over the checklist of whether cmake will meet
> the needs of my eclipse users, and their first question
> was what was the workflow for adding a new source
> file.
>
> I just tried the experiment of adding a .cpp file,
> adding it to CMakeLists.txt, and clicking Build...
> and the .o file showed up as it should have. This
> kind of surprised me, since I didn't re-run cmake.
>
> Is the generator smart enough to notice the
> changes to the CMake files and re-run cmake
> with the same environment variables and options
> as it was originally run with? I kind of doubt it.
>
> The cdt4 web page says
> "When you edit your CMakeLists.txt file, you are recommended to delete
> your project and reimport it."
> Is it assuming that you've rerun cmake manually?
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111026/6fe3b583/attachment.htm>
More information about the CMake
mailing list