[CMake] Transitive link question

Biddiscombe, John A. biddisco at cscs.ch
Tue Dec 13 17:00:43 EST 2011


>
Sure, when project A is loaded into project B it either needs to search and load the hdf5 cmake file or require that to be done in project B before loading project A. Then the hdf5 target will be known in project B too and linking will work fine.
<

Using find_package in project B is an option, but what I was really trying to ask is if there's a way to make the transitive link get the correct library on its own. Since I have a number of different versions of the hdf5 package installed, there's a chance that project B will use the wrong one (ok, not when I'm doing it because I know, but if a third party needs to do the same). Since project A knows the correct library and name/lib other target properties, I would like it to make it available to project B/C/D etc

Thanks

JB



More information about the CMake mailing list