[CMake] Making cmake automatically pick up changes to directory contents.

Bill Hoffman bill.hoffman at kitware.com
Mon Dec 2 13:34:01 EST 2013


On 12/2/2013 12:58 PM, billw at billw.mail1.co.uk wrote:
> I just finished converting a large project from VC project files to Cmake
> generated ones and am using file GLOBing to generate the file lists for
> builds. This is working fine and I don't see the benefit to explicitly
> specifying every file.
The benefit is that CMake re-runs when new files are added because you 
have to edit the cmake file.  There is no way right now to have CMake 
auto re-run when a file is added to a directory.  That is why the docs 
recommend not using glob.

To implement this you would have to figure out a very efficient way to 
check for new files in a directory every time the build is done.  In 
your case you would have to figure out how to integrate that into visual 
studio.  VS has no way to "watch" a directory so you would have to run 
cmake --check-dirs every time a build is run from VS.

-Bill



More information about the CMake mailing list