[CMake] shared and static libs with same rootname

Brandon J. Van Every bvanevery at gmail.com
Mon Aug 14 22:22:08 EDT 2006


Brandon J. Van Every wrote:
> Jorge Rodriguez wrote:
>
>
>>
>> Also, what if I turned around and did this:
>>
>> ADD_EXECUTABLE(bar ${BarSources})
>> TARGET_LINK_LIBRARIES(bar foo)
>>
>> Would it link against foo or foos?
>
> foo.  It goes by the *target* name, which must be unique in CMake.  
> Not the library name.
>

Although, if you hadn't actually defined a target named "foo", it will 
just do a straight -lfoo .  For instance I have to do -lm this way on 
Unix.  I write TARGET_LINK_LIBRARIES(bar m).


Cheers,
Brandon Van Every



More information about the CMake mailing list