<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">Thank you so much for your help<br><br>I have another problem, I have successfully created all the 3rd-party libraries.<br>I used ADD_CUSTOM_COMMAND to call the makefiles that are provided using these libraries.<br><br>Now, I want to combine all these libraries to one library. I will link against this library later.<br>I have searched google and cmake wiki. it seems that there is no straight forward way to do that.<br><br>one suggested using ar command to combine the files.<br><br>what is the vest way to merge all these libraries in one library.<br><br>Thanks<br>Mina<br><div><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> Alan W. Irwin <irwin@beluga.phys.uvic.ca><br><b><span style="font-weight: bold;">To:</span></b> mina adel <elecengineer_mina@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> cmake@cmake.org<br><b><span style="font-weight: bold;">Sent:</span></b> Sat, October 30, 2010 11:31:42 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [CMake] call already made makefile<br></font><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>..make?<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>Note the above is a reasonable interim measure to get you started, but<br>I predict that once you become more familiar with cmake you will find<br>that you will want to also build the library with cmake to completely<br>get rid of your autotools chains. :-)<br><br>Alan<br>__________________________<br>Alan W. Irwin<br><br>Astronomical research affiliation with Department of Physics and Astronomy,<br><span>University of Victoria (astro<a
target="_blank" href="http://www.phys.uvic.ca">www.phys.uvic.ca</a>).</span><br><br>Programming affiliations with the FreeEOS equation-of-state implementation<br>for stellar interiors (freeeos.sf.net); PLplot scientific plotting software<br>package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of<br>Linux Links project (loll.sf.net); and the Linux Brochure Project<br>(lbproject.sf.net).<br>__________________________<br><br>Linux-powered Science<br>__________________________</div></div>
</div><br></body></html>