[CMake] Get include directories for package dependencies

Kyle Heath heathkh at gmail.com
Wed Aug 15 21:08:41 EDT 2007


I have read the Mastering CMake book and I'm still having trouble
getting inter package dependencies working (in source trees).

The Situation:
I have a CMake managed static lib package called libA with a
libAConfig.cmake file as described in section 6.7 of Mastering CMake.
I have another Cmake managed package libB also with a libBConfig.cmake
file that uses package libA.  I have another cmake project that
generates an executable that directly depends only on libB.

The Problem:
The header directories for libB are included for the executable target
but not those of libA (on which libB depends).  The
EXPORT_LIBRARY_DEPENDENCIES macro doesn't record any of the include
directories or the name of the package so I don't see any mechanism
for CMake to walk the dependency chain to collect this information.

The Question:
For CMake to handle package dependencies correctly, it must have a way
to collect all the required header include directories by walking the
dependency chain.  This doesn't seem to happen by default.  What is
the mechanism to do this correctly?

Thanks,
Kyle


More information about the CMake mailing list