[CMake] How to specify library dependencies?
a.neundorf-work at gmx.net
Mon Nov 24 16:39:59 EST 2008
On Monday 24 November 2008, Robert Dailey wrote:
> 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.
You could do:
(with error checking and checking CMAKE_SYSTEM for Linux)
More information about the CMake