<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Thank you for your help.<br><br>I used ADD_Custom_Command() to run the makefiles of 3rd-partylibraries.<br><br>My problem is how to combine these generated (static) libraries into one static library using cmake to be used later in my project?<br><br>The problem is since I used add_custom_command to run cmake. I can not know the object files generated. And I can not use them to build a bigger library. what is the easiest way to combine these libraries using cmake? <br><br>Thanks<br>Mina<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> SK <sk@metrokings.com><br><b><span
style="font-weight: bold;">To:</span></b> Alan W. Irwin <irwin@beluga.phys.uvic.ca><br><b><span style="font-weight: bold;">Cc:</span></b> mina adel <elecengineer_mina@yahoo.com>; cmake@cmake.org<br><b><span style="font-weight: bold;">Sent:</span></b> Thu, November 4, 2010 7:59:49 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [CMake] call already made makefile<br></font><br>On Thu, Nov 4, 2010 at 4:29 PM, SK <<a ymailto="mailto:sk@metrokings.com" href="mailto:sk@metrokings.com">sk@metrokings.com</a>> wrote:<br>> On Sat, Oct 30, 2010 at 8:31 AM, Alan W. Irwin<br>> <<a ymailto="mailto:irwin@beluga.phys.uvic.ca" href="mailto:irwin@beluga.phys.uvic.ca">irwin@beluga.phys.uvic.ca</a>> wrote:<br>>> On 2010-10-29 20:50-0700 mina adel wrote:<br>>><br>>>><br>>>> Hi All<br>>>><br>>>> I have an open source code that I use in my project. This open source
code<br>>>> already has Makefile coded for it.<br>>>><br>>>> I want to use cmake so that before it compile my project it first call the<br>>>> cmake of these open source code, which will compile it to .la library.<br>>><br>>> ..make?<br>>>><br>>>> Then using this library, it compile my code.<br>>><br>>> I assume from the context you mean make rather than cmake above.<br>>><br>>> To run make (or any command) at run-time, use the combination of<br>>> add_custom_command and add_custom_target. Basically,<br>>> add_custom_command creates an OUTPUT file (say your library) at run<br>>> time, and add_custom_target file-depends on that file and creates a<br>>> CMake target corresponding to the custom command which you can add as<br>>> a dependency of your application target. This insures make will be run (if<br>>> the library
is not up to date) before your application is built.<br>>><br>><br>> No, this does not work when the external command is a make process.<br>> The problem is that the "output" of add_custom_command() is a target<br>> with it's own dependencies. The external make process must always run<br>> in order catch dependencies that only the external make knows about.<br>> The only way to make sure the make process always runs is to use<br>> add_custom_target(), but alas, add_custom_target does not allow us to<br>> specify an output.<br>><br>> See this thread from a few days ago: add_custom_command depends on<br>> output from add_custom_target.<br>><br>> As far as I know, there is no satisfactory way to do use external<br>> makefiles with CMake. I'm all ears if anyone has suggestions.<br>><br><br>I filed a feature request for better external makefile support by way<br>of output from
add_custom_target()<br><a href="http://cmake.org/Bug/view.php?id=11407" target="_blank">http://cmake.org/Bug/view.php?id=11407</a><br><br>How about for 2.8.4?<br></div></div>
</div><br></body></html>