[CMake] What is the preferred method of handling inter-library dependencies?

William A. Hoffman billlist at nycap.rr.com
Thu Jul 13 16:52:37 EDT 2006


At 04:41 PM 7/13/2006, Alan W. Irwin wrote:
>On 2006-07-13 14:35-0400 William A. Hoffman wrote:
>
>>At 02:01 PM 7/13/2006, Alan W. Irwin wrote:
>>>What are the preferred entries for TARGET_LINK_LIBRARIES?
>>>
>>>"Minimal dependencies", i.e.,
>>>TARGET_LINK_LIBRARIES(x y)
>>>TARGET_LINK_LIBRARIES(y z)
>>>TARGET_LINK_LIBRARIES(z external1 external2)
>>
>>This should work fine in CMake.
>>The libraries will be chained automatically.
>
>Thanks, Bill, for your response.
>
>How do I get access to the actual link flags used for the link command
>generated by cmake (which presumably includes all the appropriate -L and -l
>flags to access lib[xyz] and libexternal[12] as well as platform-dependent
>link flags).  I need those actual link flags to configure pkg-config files
>that describe how external applications should link to libx, liby, and libz.

That is a harder question, which is why I ignored it... :) 

The information is not to hard to get at from c++, and some if it
is in the cache.  It may require some sort of new cmake built in command
to create pkg-config files.  Is anyone doing something like this?

-Bill



More information about the CMake mailing list