[Cmake] [PATCH] Custom LIB/EXE output path for each CMakeList.txt

Brad King brad . king at kitware . com
Fri, 18 Jul 2003 08:07:14 -0400 (EDT)


Nitin,

> The solution does not seems to work for Linux builds, mainly when an
> executable in higher CMakeLists.txt *depends* upon the library in one of
> SUBDIRs.

This dependency order will not work anyway.  During the first build when
the library isn't there, cmake will jump over and build the library first.
Later, though, it will not keep the library up to date before building the
executable.  It will try to link the executable and then update the
library.  The problem is that we had to pick an order in which to visit
the directories in the tree.  We chose a post-order walk so that testing
executables could be placed in subdirectories under their libraries.  All
our projects' application executables are in directories that come after
the libraries in a post-order walk.

We have a feature-request bug entry already present to add a PREORDER
option to the SUBDIRS command that would allow some subdirectories to be
walked first.

-Brad