[CMake] Getting Makefiles sensitive to new/deleted files/directories?

Convey Christian J NPRI ConveyCJ at Npt.NUWC.Navy.Mil
Wed Mar 19 09:59:55 EDT 2008


Many of my CMakeLists.txt files has code like this:

FILE(GLOB SRC *.cpp *.c)
ADD_LIBRARY(my_lib ${SRC})

My users occasionally get tripped up because after someone adds a new .cpp file, the other users forget to rerun "cmake" before running "make".

Has anyone considered enhancing CMake so that when the set of source files picked up by a FILE(GLOB ...) command changes, cmake is automatically re-run?

Even if a new command had to be added, or a new option to the FILE(...) command, that would be fine.  But this is probably the main problem I'm seeing my users encounter with our CMake-based build system.  I'd be very happy if we could eliminate it.


Christian Convey
Scientist, Naval Undersea Warfare Centers
Newport, RI



More information about the CMake mailing list