[CMake] automatic library dependencies causing problems

Clinton Stimpson clinton at elemtech.com
Thu Feb 3 16:22:28 EST 2005


I've found a solution for my problem.

When I build libD.so, I add "-all" to export symbols from the static 
libraries E-H.
Then libA.so and libB.so won't get their own copies of libs E-H, and the 
linker will emit a warning saying that they were ignored.

  IF(CMAKE_SYSTEM MATCHES "IRIX")
    SET_TARGET_PROPERTIES(D PROPERTIES LINK_FLAGS -all)
  ENDIF(CMAKE_SYSTEM MATCHES "IRIX")

Thanks,
Clint


William A. Hoffman wrote:

>This example is to complicated.   Can you provide a smaller one that shows
>the problem?
>
>Basically, cmake only does what you tell it.   Sounds like you need
>to remove a TARGET_LINK_LIBRARIES or a LINK_LIBRARIES command.
>
>I would expect you could create an example in one cmakelist file that showed
>the problem.
>
>
>-Bill
>
>
>
>At 11:57 AM 2/3/2005, Clinton Stimpson wrote:
>  
>
>>Hi,
>>
>>I've got a project that is supposed to be like this
>>
>>   
>>    A
>>   / \
>>   D  B
>>       \
>>        D
>>     / / \ \
>>     E F  G H
>>
>>And lets say that libraries E, F, and G are static libraries and all the others are shared.
>>And let's say that E and F are built by CMake in the same project and G is an external one.
>>The static ones should only be linked into D and not into A and B.  
>>CMake does link them in and A and B end up being much larger than they need to be because they have their own copies of E, F, and G.
>>How do I turn off the automatic library dependencies so that they don't get linked into A and B?
>>The code is functional on several platfoms except IRIX.
>>On IRIX, this is causing the code to be non functional because it uses the wrong copies of static variables in libraries E and F.
>>
>>Thanks,
>>Clint
>>
>>_______________________________________________
>>CMake mailing list
>>CMake at www.cmake.org
>>http://www.cmake.org/mailman/listinfo/cmake
>>    
>>
>
>  
>



More information about the CMake mailing list