Am Samstag, 25. August 2012 um 12:04:21, schrieb Alexander Neundorf <a.neundorf-w...@gmx.net> > On Saturday 25 August 2012, Russell Wallace wrote: > > I don't understand what you mean, but explicit listing violates DRY in > > a big way with the usual consequence, the two lists will inevitably > > get out of sync. > > Yes, but here this is good IMO, since in general a file laying around in some > directory does not necessarily belong to the project. > > > I'd rather use globbing (unless CMake has some other > > method that doesn't involve trying to keep things in sync by hand)? > > There is not much "trying" involved. You notice immediately if a file is > missing in your CMakeLists.tx or if you list a file which does not exist.
If a file is missing, you notice it in both cases. If you add a file (without touching CMakeLists.txt of course) you will not notice in both cases. > > Even plain Make can use globbing reliably. > > You can use file(GLOB ...), but it is not recommended. > When a new file is added to a target, cmake needs to rerun, to generate the > rules for building this file and to link the target. > In the makefiles generated by cmake there is the dependency to rerun cmake > when any of its input files have changed (e.g. when you added or removed a > source file), but there is no rule to rerun cmake if anything in a directory > has changed. So simply adding a file to a directory will not cause cmake to > rerun automatically. > By having to add that file explicitely to the CMakeLists.txt, cmake will > rerun > and you will always have a consistent build system. > > Alex Kornel
signature.asc
Description: This is a digitally signed message part.
-- 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