[Cmake] Exporting library dependencies

Brad King brad.king at kitware.com
Fri Jul 30 12:33:39 EDT 2004


Amitha Perera wrote:
> The current CMake way of exporting library dependencies from one tree
> to another---using EXPORT_LIBRARY_DEPENDENCIES and
> FIND_PACKAGE---only exports the dependencies required for
> linking. This means two things. (1) the method will only would when
> the first project uses LIBRARY_OUTPUT_PATH to put all the libraries
> into one place. (2) when libraries in the first tree change, the
> makefiles in the second tree have no way to rebuild affected targets.

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.  Then the paths 
in VTK_LIBRARY_DIRS are set differently for the build tree and install 
tree (there is a separate VTKConfig.cmake file generated for each one). 
  Having a more automated solution would be great if you can come up 
with one.  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.

-Brad



More information about the Cmake mailing list