On 17 January 2012 13:21, David Cole <david.c...@kitware.com> wrote: > If you want to use file GLOB at CMake time, then you have to re-run > CMake manually when you add or remove a file. There's no way around > that, because we are not going to monitor your hard drive for > arbitrary file changes on a continuous basis...
On 17 January 2012 13:22, Rolf Eike Beer <e...@sf-mail.de> wrote: >> Thanks Andreas, but that leaves us with having to edit the >> CMakeLists.txt every time we add a pattern file. There must be a >> better way? > > How should CMake find out that it needs to update it's file list then? It could re-run the FILE(GLOB) on every build? Instead of making a dependency on a list of files, I would like to make a dependency on the contents of a folder. Thanks for all the replies. I understand that the recommended method is to have an explicit list of files. And I can see the benefits for avoiding slip-ups like adding a file without checking it in. What confuses me now is that for packaging we can use the INSTALL command: # copy the patterns from the source folder install( DIRECTORY "patterns" DESTINATION "." FILES_MATCHING PATTERN "*.vti") This does exactly what I want: it finds all the *.vti files from the "patterns" folder and subfolders. And yet there's no matching command to achieve this in the normal build? Is using the INSTALL command like this not recommended? -- Tim Hutton - http://www.sq3.org.uk - http://profiles.google.com/tim.hutton/ -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake