[CMake] dependency problem

Torri, Stephen CIV NSWCDD, W15 stephen.torri at navy.mil
Tue Jun 8 16:21:05 EDT 2010


> 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
 
 


More information about the CMake mailing list