[CMake] How to specify library dependencies?

Robert Dailey rcdailey at gmail.com
Mon Nov 24 16:29:50 EST 2008

On Mon, Nov 24, 2008 at 2:41 PM, Michael Jackson <
mike.jackson at bluequartz.net> wrote:

> typically you do:
> add_executable(main  main.cpp)
> target_link_libraries(main a)
> and CMake _usually_ picks the correct library for the given platform
> (a.lib, a.so, a.dylib... )
> Is that what you were asking?

Yes, you did answer my question exactly, however I did not specify the more
complex issue.

Some libraries we're using have different library names depending on the
platform. For example:


This is why I believed I would need the conditional logic. What would you do
in this case? Thanks for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081124/643d5592/attachment.htm>

More information about the CMake mailing list