On Wed, Nov 26, 2008 at 7:27 PM, Bill Hoffman <[EMAIL PROTECTED]>wrote:
> Robert Dailey wrote: > >> Hi, >> >> I have about 20 directories that contain source files. However, the FILE() >> call I make to each directory will have a different glob expression. I need >> to be able to do FILE( GLOB ..... ) about 20 times and each time have it >> append to the existing variable I give it. Is this possible? What would be >> the recommended way of accumulating a list of files in all 20 directories? >> >> > find . -name "*.c" > source_files.txt > edit source_files.txt and put that list of files exiplicitly into a > CMakeLists.txt file. > > file(GLOB is a bad way to get source lists for CMake. CMake has no way of > knowing when new files have been put in the directory. But unless I am missing a fundamental feature somewhere, GLOB still seems to be the better alternative. While it may not intrinsically know when new files have appeared on the filesystem, the programmer can simply re-run the CMake command to get an updated project with the newly added source files without editing the CMakeLists.txt file directly. This is better than the alternative, which is a hard-coded list of project files in the CMake script.
_______________________________________________ CMake mailing list [email protected] http://www.cmake.org/mailman/listinfo/cmake
