[CMake] Makefile regeneration on added/removed files

Andreas Pakulat apaku at gmx.de
Fri Jan 16 13:41:33 EST 2009


On 16.01.09 12:59:23, Naram Qashat wrote:
> Is it possible to have CMake be re-run either automatically or via a 
> Makefile target if files are added or removed from one of the directories 
> that CMake has previously checked?  I know that checking for changed 
> files is a job of the Makefile, but I am unaware if there is a way for 
> either (g)make or CMake to check for files being added or removed.  If 
> this can't be done, I will continue to recommend that CMake be re-run 
> manually if files are added or removed.

I assume you're using GLOB to get the list of sources? This is considered
to be bad practice, you should list your source files in the CMakeLists.txt
file in which case adding a new file will re-run cmake automatically
because you changed the CMakeLists.txt.

And to clearly answer your question: No its not possible to re-run cmake
when you add a file, if you use GLOB-stuff to create the list of source
files.

Andreas

-- 
Artistic ventures highlighted.  Rob a museum.


More information about the CMake mailing list