[Cmake] Set a variable to a list of filenames that match a pattern

Bill Hoffman bill . hoffman at kitware . com
Thu, 24 Jul 2003 14:57:17 -0400


For most of our work we use your suggestion 1.
This is what we refer to as "out of source" builds.
This is really the best way to run CMake, and it is supported
by CMake on all platforms.  It makes it very easy to remove
an entire build, or have several builds at the same time.
It is a small change for developers that are not used
to CMake, but once you get used to it, it really is nice.
It is very useful when building with different compilers.

For example, you can do things like this:

ProjectSource

ProjectBuild-Microsoft
ProjectBuild-Borland
ProjectBuild-Cygwin
ProjectBuild-Intel

Where all there build trees share a single source tree.
Changes can be made in the source tree and tested for all
the different configurations.  That is not possible with
in-source builds.

-Bill



>1. Use separate build and source trees.  This would be my
>preference for a new project in any case; it solves a lot of
>problems, not just the path question.  It might be difficult 
>to put in place on a project that has a couple of years 
>of history already.  On the other hand, unlike the ideas
>below, this procedure is self-enforcing.