[CMake] How to link a .so file under linux?

Ning Cao ningcao at uky.edu
Mon Nov 1 20:56:39 EST 2004


hi, Andy,

Thank you for your help.
Finally I found what's wrong with me. Instead of using the library libxxxx.so, the lib file is named as xxxxlib.so. CMake failed to process properly I think. It is ok if I rename the .so file.

I will have a look at the CMake source to see if it is the manner of CMake.

Best Regards,
Yours,
Ning 
----- Original Message ----- 
From: "Andy Cedilnik" <andy.cedilnik at kitware.com>
To: "Ning Cao" <ningcao at uky.edu>
Cc: <cmake at www.cmake.org>
Sent: Friday, October 29, 2004 11:54 AM
Subject: Re: [CMake] How to link a .so file under linux?


> Hi Ning,
> 
> Two options:
> 
> 1. Just do TARGET_LINK_LIBRARIES(program /path/to/library.so)
> 
> 2. Better one is to:
> 
> FIND_LIBRARY(MY_LIB NAMES library
>              PATHS /path/to)
> TARGET_LINK_LIBRARIES(program ${MY_LIB})
> 
> Andy
> 
> On Fri, 2004-10-29 at 10:19, Ning Cao wrote:
>>     I want to link a .so file (provided by others) to my executable file.
>>     Could anyone tell me how to do this with CMake?
> 
> 
> 
>


More information about the CMake mailing list