[CMake] plugin dependencies and TARGET_LINK_LIBRARIES()

Hendrik Sattler post at hendrik-sattler.de
Tue Jun 15 13:40:10 EDT 2010


Am Dienstag 15 Juni 2010, 18:48:04 schrieb Kishore:
> How do i inform cmake when building a module that it depends on another
> module? Does cmake need to even know that?
> 
> I am building a plugin based qt application (my first time with plugins)
> and my situlation like with many other applications is that plugin A
> depends on plugin B. In my application i take care to load plugin B before
> A. However, loading plugin A fails complaining that it could not resolve
> links which are in B. plugin B which only depends on the application loads
> fine.
> 
> Now, everything works fine if i declare that plugin A depends on B using
> the TARGET_LINK_LIBRARIES() function. But for this to work, i have to
> declare both A and B as SHARED instead of MODULE libraries.
> 
> What is the right way to go? I believe that since my application loads B
> before A, B should not fail to load and there really should be no need for
> the TARGET_LINK_LIBRARIES() call.

What about splitting the common part of B into a library that both B and A 
link to?

HS


More information about the CMake mailing list