<br><br><div class="gmail_quote">2011/6/27 Michael Wild <span dir="ltr">&lt;<a href="mailto:themiwi@gmail.com">themiwi@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 06/27/2011 11:31 AM, Maxime Lecourt wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m using CMake to build OCaml libraries.<br>
&gt; For that, I use a macro that I call in my CMakeLists.txt<br>
&gt;<br>
&gt; As I have dependencies between my different libraries, I wrote my<br>
&gt; CMakeLists.txt so the build happens in the right order, but when<br>
&gt; building, libraries are built depending on alphabetical order.<br>
&gt;<br>
</div>&gt; add_ocaml_library(cabs SOURCES <a href="http://cabs.ml" target="_blank">cabs.ml</a> &lt;<a href="http://cabs.ml" target="_blank">http://cabs.ml</a>&gt;)<br>
&gt; add_ocaml_library(algo SOURCES <a href="http://algo.ml" target="_blank">algo.ml</a> &lt;<a href="http://algo.ml" target="_blank">http://algo.ml</a>&gt;)<br>
<div class="im">&gt;<br>
&gt; (algo depends on cabs being already built)<br>
&gt;<br>
&gt; How can I create a &quot;add_ocaml_dependencies&quot; macro ?<br>
&gt; Or is there a way to force CMake to follow the build order in the<br>
&gt; CMakeLists.txt ?<br>
&gt;<br>
&gt; Regards<br>
&gt;<br>
&gt; Maxime Lecourt<br>
&gt;<br>
<br>
</div>Well, if cabs and algo are top-level targets (i.e. created via<br>
add_library(), add_executable() or add_custom_target()), you can simply<br>
call add_dependencies(algo cabs).<br>
<br>
Michael<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br>algo and cabs are created using add_custom_command()<br><br>I tried add_dependencies(algo cabs), but it did not work.<br>Would it work if i create a fake target (can I force cabs and algo as top-level targets, or as valid parameters for add_custom_target ?) ?<br>
<br>add_custom_target(target1 depends cabs)<br>add_custom_target(algo depends target1)<br><br><br>Or something like that.<br><br>Maxime Lecourt<br>