[Cmake] More control on CMake...

Brad King brad . king at kitware . com
Thu, 11 Sep 2003 13:06:31 -0400 (EDT)


> In my project I have two executables, and four sub-directory libraries.
> One of my executable target requires all four sub-directory libraries.

CMake will never let a target in a parent directory depend on a target in
a subdirectory (at least the UNIX makefile generate).  It lets the
opposite occur, though, so that library directories can have
subdirectories with tests.  You can get the behavior you want by putting
the executable in another subdirectory:

SUBDIRS(LibA LibB LibC LibD ExeDir)

And then in the ExeDir:

TARGET_LINK_LIBRARIES(myexe A B C D)

-Brad