[CMake] How to surround an imported lib with extra flags onlink?

Alexandre Feblot Alexandre.Feblot at thomsonreuters.com
Tue Mar 31 08:36:06 EDT 2009


Hi Martin,

Well, I came to this ugly platform-dependant workaround. I hate that,
but it works.

Example: Here, libC depends on libB which depends on libA. To surround
libB:

IMPORTED_LINK_INTERFACE_LIBRARIES for libB: "-z defaultextract;libA"
IMPORTED_LINK_INTERFACE_LIBRARIES for libC: "-z allextract;libB"

What do others think about a real solution for this as a feature
request?

Alexandre 
 
-----Original Message-----
From: Martin Apel [mailto:martin.apel at simpack.de] 
Sent: Tuesday, 31 March 2009 14:08


Hi Alexandre,

I don't think that CMake is able to handle this. I searched for a
solution to a similar problem involving the use of the --start-group and
--end-group option for ld on Linux. You might be able to define custom
rules for this, but then you are definitely on platform-dependent
ground. Probably this would be something for a feature request.
If you find a solution to this, please let me know.

Best Regards

Martin

Alexandre Feblot wrote:
>
> Hi again,
>
> Would anybody have a solution for this?
>
> Thanks
>
> Alexandre
>
>
------------------------------------------------------------------------
>
> *Sent:* Monday, 30 March 2009 17:31
>
> Hi,
>
>  
>
> I import some libs like this:
>
>  
>
>         add_library(${name} ${type} IMPORTED)
>
>         set_target_properties(${name} PROPERTIES
>
>             IMPORTED_LINK_INTERFACE_LIBRARIES "${other_imported_libs}"
>
>             IMPORTED_LOCATION "${file}"
>
>         )
>
>  
>
> At the end, I link an executable which gets all required libs thanks
> to the imported interface property.
>
>  
>
> Now, I need one of these imported libs to be surrouned like this: -z
> allextract ${the_lib} -z defaultextract
>
>  
>
> I find no working way to add these flags in the
> IMPORTED_LINK_INTERFACE_LIBRARIES properties to get them properly at
> link time. What solution do I have?
>
>  
>
>  
>
> Thanks
>
>
> 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. 


____________
Virus checked by G DATA AntiVirus
Version: AVF 19.323 from 30.03.2009




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.




More information about the CMake mailing list