[CMake] Compilation sequence

Brad King brad.king at kitware.com
Wed Jul 26 15:01:44 EDT 2006


Flávio P. Duarte wrote:
>  my project is an application with 4 libs. The application is located in
> the root directory and each lib corresponds to one subdir in the root
> dir. Since I am using Qt, I have a bunch of header files that are
> generated at compile time and, to make things worst, one lib includes
> headers generated by the other lib, which forces the compilation in a
> specific order. I've tried to set this order using SUBDIRS command, but
> CMake change that even using PREORDER option.
> Is there any to override the compilation sequence ?

The directory ordering no longer has influence over the build order
(other than the order that happens to be chosen for a single-threaded
build).  Proper inter-target dependencies must be added.  If a library
or executable links to a library the dependency on the linked library is
automatic.  Extra inter-target dependencies can be added with
ADD_DEPENDENCIES.

-Brad


More information about the CMake mailing list