On Wed, Sep 23, 2009 at 11:08:38AM +0200, Jeroen Dierckx wrote:
> 2009/9/22 Tyler Roscoe <[email protected]>:
> > On Tue, Sep 22, 2009 at 08:34:36PM +0200, Jeroen Dierckx wrote:
> >> What we do in our build system is using file(GLOB to get all .cmake
> >> files in a "targets" directory, and including those. That way, to add
> >> additional targets, all the developers have to do is add a .cmake file
> >> to that directory.
> >
> > This is not a recommended practice. If you do it this way, CMake can't
> > notice if new lists files have been created (or removed) and thus cannot
> > trigger a rebuild of the CMake binary tree when it should.
> 
> I agree that this shouldn't be recommended in general, but in our
> specific build environment the developers know that they have to run
> cmake when they add targets (or even source files, because adding
> those are automated too).
> The overhead of having to run cmake themselves is a lot less than the
> work they would have to do edit a main CMakeLists.txt file and
> managing conflicts therein. Most of the time, some options for the new
> targets have to be set in cmake anyway.

The overhead is only less until a developer wastes an hour or two trying
to track down why his new source file isn't being compiled.

It's a Best Practice for a reason. If you aren't following it, I'm sure
you have terrific reasons and that you know exactly what you're doing...
just like everyone else who decides to go against a Best Practice :).

good luck,
tyler
_______________________________________________
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

Reply via email to