[CMake] How to describe lib dependencies when a lib has different possible implementations?

Alexandre Feblot Alexandre.Feblot at thomsonreuters.com
Thu Mar 19 12:47:41 EDT 2009


Hi,
 
I'm facing an issue while trying to port my current build system to
cmake and don't know is there is a way to solve it:
 
In our project, we build a bunch of static libs (about 360) and several
executables on them.
 
* one library, in the middle of the lib dependency chain, has in fact 2
different implementations. That is to say, there are 2 different libs
with the exact same interface, but they don't use the same back-end,
have different source code, and don't have the same dependencies.
* only one of them has to be used in every executable, the
implementation to use is determined by the executable.
 
Dependency graph example: "->" means "depends on"
 
exe1-A -> lib1 -> lib3 -> lib4-A -> lib5 -> lib7
exe1-B -> lib1 -> lib3 -> lib4-B -> lib6 -> lib8
exe2-A -> lib2 -> lib3 -> lib4-A -> lib5 -> lib7
exe2-B -> lib2 -> lib3 -> lib4-B -> lib6 -> lib8
 
 
I'd like to keep using the standard cmake mechanism of dependency
description in which every lib only defines on which other libs it
depends, and let cmake compute the final link line.
 
The question is: how can I express the dependencie of lib3 on lib4
whereas lib3 has only a single description, and we don't know when
describing it, if we'll have to use lib4-A or lib4-B. (and anyway,
depending on the executable, we'll have to use each of them).
 
Is there any concept of "abstract" target (lib4 in my example) which
could be "instanciated" in the executable description (as lib4-A or
lib4-B in the example)
 
 
Thanks,
 
Alexandre
 


This email was sent to you by Thomson Reuters, the global news and information company.
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090319/4458f59d/attachment.htm>


More information about the CMake mailing list