[CMake] Targets organisation of complex project

Chris Foster chris42f at gmail.com
Mon Oct 12 03:24:23 EDT 2009


On Mon, Oct 12, 2009 at 4:54 PM, Hendrik Sattler
<post at hendrik-sattler.de> wrote:
> Zitat von Mateusz Loskot <mateusz at loskot.net>:
>> http://www.cmake.org/pipermail/cmake/2008-March/020315.html
>>
>> It actually smashed my original idea :-)
>
> Why? I think you misunderstood what is written there.
> It just tells you that the interdependencies of those static libs must be
> tree-like. If you cannot ensure this within your project, then you must use
> the all-at-once approach.

Quoting from the linked mail,

"""
  Combining static libs into a shared lib is not really portable, you have to
  take care that you use the correct linker flags for the libs so that it will
  work.
"""

This is the reason I wouldn't consider the "link all the static libs
into a shared lib" approach.  For instance, on x86_64/gcc you need to
compile any files which will eventually become shared objects with the
-fPIC flag, but this doesn't happen automatically when creating static
libs.

AFAIK the flag isn't necessary on x86, and it may be something
different again on other platforms, hence the "not really portable"
comment I suppose.

~Chris


More information about the CMake mailing list