[CMake] LINK_FLAGS works incorrectly,

Michael Wild themiwi at gmail.com
Mon Apr 18 16:07:04 EDT 2011


On 04/18/2011 07:37 PM, Łukasz Tasz wrote:
> Hi,
> 
> Of course I read manual. But I'm a little bit confused. That's why I'm
> asking about idea behind LINK_FLAGS,
> 
> Cmake is not consequent because when I'm adding:
> 
> add_library(test foo.cxx bar.cxx)
> SET_TARGET_PROPERTIES( test PROPERTIES SOVERSION 1.2 VERSION 1.1)
> 
> it 'magicaly knows' how to build linking commands and according to gcc
> manual it is done in a way:
> 
> -Wl,-soname,libtest.so.1.2
> 
> 
> I'm also fine with answer that it is not implemented, and I need to
> handle it by myself.
> I would like to understand why for some linker switches cmake is
> aligning it correctly, for some not.
> 
> best regards
> Lukasz
> 
>>
>> However, there are flags for the linking stage of the compiler that do not
>> directly translate to -Wl,--somthing but e.g. instruct gcc what libraries to
>> use (or not) for linking.
>> Just look at "Options for Linking" in  "man gcc".
>>
>> HS
>>
> 
> 
> 

CMake can't possibly know all flags of each version of all tools out
there, that's just plain ludicrous. SOVERSION and VERSION are directly
supported by CMake, and the maintainers try very hard to make sure these
features work as expected. For the rest it's your responsibility to do so.

Michael


More information about the CMake mailing list