[CMake] dependency problem

Yifei Li yifli at mtu.edu
Tue Jun 8 19:20:55 EDT 2010


> 
> Thank you.
> 
> The reason I used find_library is because I found out that I don't need to say libMyLib.so or libMyLib.dylib in target_link_libraries, I can just say MyLib.
> 
> Correct me if I am wrong
> 
> Yifei
> On Jun 8, 2010, at 4:21 PM, Torri, Stephen CIV NSWCDD, W15 wrote:
> 
>>> From: cmake-bounces at cmake.org on behalf of Yifei Li
>>> Sent: Tue 6/8/2010 4:15 PM
>>> To: cmake at cmake.org
>>> Subject: Re: [CMake] dependency problem
>>> 
>>> Thank you for reply.
>>> 
>>> I already tried that.  I think the problem was caused by 'find_library' in my plugin's CMakeLists.txt, because it failed to find 
>>> MyLib
>>> 
>>> I use a variable to hold the result of 'find_library'  and that variable is in turn used in target_link_libraries
>> 
>> Assuming both "MyLib" and the plugin exist in the same project I could do this
>> 
>> (CMakeLists.txt for MyLib)
>> add_library ( MyLib SHARED ${SOURCE})
>> 
>> (CMakeLists.txt for plugin)
>> add_dependencies ( MyLib )
>> add_library ( plugin SHARED ${SOURCE} )
>> target_link_libraries ( plugin MyLib )
>> 
>> I don't see you needing to use find_library. That is intended to find a library external to the existing project. It should not be necessary to find a library internal to a project.
>> 
>> Stephen
>> 
>> 
>> _______________________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
> 



More information about the CMake mailing list