[CMake] dependency problem

Yifei Li yifli at mtu.edu
Tue Jun 8 16:15:15 EDT 2010


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


Yifei
On Jun 8, 2010, at 3:57 PM, Torri, Stephen CIV NSWCDD, W15 wrote:

>> From: cmake-bounces at cmake.org on behalf of Yifei Li
>> Sent: Tue 6/8/2010 3:23 PM
>> To: cmake at cmake.org
>> Subject: [CMake] dependency problem
>> 
>> Hi folks,
>> 
>> I'm new to cmake, can anyone help me with the following situation:
>> 
>> I have a project which will generate following targets:  1) the application and a shared library, say MyLib.  2) some 
>> plugins(which are also shared libraries) that need to link MyLib, each plugin has its own cmakelists.txt
>> 
>> The problem is when CMakeLists.txt for a plugin is parsed, MyLib does not exist.
>> 
>> What is the correct way to handle this situation?
> 
> So the plugin depends on MyLib. I would look at adding a add_dependcies to the plugin CMakeLists.txt.
> 
> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_dependencies
> 
> 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