[Cmake] Exporting library dependencies

Amitha Perera perera at cs.rpi.edu
Fri Jul 30 14:11:49 EDT 2004


Brad King wrote:
> Right now this is handled in VTK and ITK by setting a
> VTK_LIBRARY_DIRS variable in VTKConfig.cmake and doing a
> LINK_DIRECTORIES(${VTK_LIBRARY_DIRS}) in UseVTK.cmake.

Exactly. This allows the linker to function well, but not the
dependencies. I'm not sure I communicated my basic point clearly in my
previous email, so I'll repeat. Suppose an exectuable E in the second
tree depends on a library L in the first tree. If we rebuild L and do
"make" on E, E should rebuild. Currently, it will not.

> Having a more automated solution would be great if you can come up
> with one.

I think the solution involves to export the *_CMAKE_PATH
variables. I'll explore this.

> I believe that targets do know where they will be installed, so it
> is possible to automate this for both the build tree and install
> tree.

I have never used the install feature of CMake, so I don't know what
is involved there. I'll look into the uninstall way first, and then
look into the install way.

Amitha.


More information about the Cmake mailing list