[CMake] How to link a library?

Enrique Izaguirre enrique.izaguirre at gmail.com
Wed Feb 2 14:18:49 EST 2011


Hello,

I have tried several ways to link an Api library to my project, but
everything I've done so far is unsuccessful.

I have a .lib file named AdbWinApi.lib in the address
${myProject_SOURCE_DIR}/android/development/windows/usb/api

I am trying to link this library to myProject, first I used the following:

find_library(AdbWin_LIBRARY
     AdbWinApi.lib
     ${myProject_SOURCE_DIR}/android/development/windows/usb/api
     )

then I used a simple way to assert it was found:

if (${AdbWin_LIBRARY})
    message (STATUS "AdbWin library found")
    target_link_library (myproj ${AdbWin_LIBRARY})
endif ()

but always it is unsuccessful.

Even though it looks pretty straight forward, I have not been able to link
it.

Can you help me please?

Thanks

BR

Enrique
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110202/252bf9f1/attachment.htm>


More information about the CMake mailing list