[Cmake] Multiple PROJECTS with dependencies

Amitha Perera perera at cs.rpi.edu
Mon Aug 23 17:35:00 EDT 2004


Hi

Recent versions of CMake output a .sln or .dsw file for each PROJECT
command, allowing you to build subtrees independently. Is it possible
to add the dependencies of the targets in the subproject to the
project?

Example:

# In (root)
PROJECT( main )
SUBDIRS( A )
SUBDIRS( B )

# In (root)/A
PROJECT( projA )
ADD_LIBRARY( libOne )
ADD_LIBRARY( libTwo )

# In (root)/B
PROJECT( projB )
ADD_EXECUTABLE( exec1 )
TARGET_LINK_LIBRARIES( exec1 libOne )


In this case, there will be a projB.sln generated. In this will be
a project for exec1. Is it possible to have projB.sln also contain
the project from libOne, on which exec1 depends?

This is would be very useful when working with large projects where
an individual often only works on a small part.

Thanks,
Amitha.


More information about the Cmake mailing list