Thanks for your help. It is solved. A dependency between custom targets
was missing. In fact, the dependency was just between the custom
command outputs and I didn't think that setting a dependency between
custom targets would have solved the problem.<br>
<br>I also have had to generate objects in separate directories (a
directory per target). Indeed, in the example of Keyan, some files are
compiled twice and there is no dependency between the two targets. So,
if I compile all files in the same directory, a file may be compiled
and used in a link command at the same time. It is a much more complex
with separate directories and I have to revise ocamldep output but it
works.<br>
<br>I don&#39;t have so much time for the moment but I will take a look at
your CMake files as soon as possible to test and improve my scripts.<br><br>Thanks,<br><br>J. Bedouet<br><br><br><br><div class="gmail_quote">2010/1/26 Alan W. Irwin <span dir="ltr">&lt;<a href="mailto:irwin@beluga.phys.uvic.ca">irwin@beluga.phys.uvic.ca</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On 2010-01-26 00:28+0100 Judicaël Bedouet wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I see one solution : add a macro to create an only target with all OCaml<br>
libraries and executables, but it&#39;s not perfect.<br>
</blockquote>
<br></div>
This issue should be straighforward to solve with proper dependencies for<br>
_both_ custom targets and custom command OUTPUT files. We have our own<br>
independent method of compiling OCaml libraries and executables which takes<br>
care of such dependency issues correctly. See<br>
<a href="http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/bindings/ocaml/CMakeLists.txt?view=log" target="_blank">http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/bindings/ocaml/CMakeLists.txt?view=log</a>,<br>

<a href="http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/bindings/ocaml/plcairo/CMakeLists.txt?view=log" target="_blank">http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/bindings/ocaml/plcairo/CMakeLists.txt?view=log</a>,<br>

and<br>
<a href="http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/examples/ocaml/CMakeLists.txt?view=log" target="_blank">http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/examples/ocaml/CMakeLists.txt?view=log</a>.<br>

<br>
Our method is pretty brute force (a series of add_custom commands and<br>
add_custom targets) so we are open to adopting something different if this<br>
current thread results in something that ultimately ends up as part<br>
of a CMake release.<br>
<br>
Note, our current method does work fine for parallel builds. Thus, it should<br>
also be straightforward to make parallel builds work properly for any other<br>
method of building ocaml libraries and apps if the necessary target and file<br>
dependencies are handled correctly.<br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Astronomical research affiliation with Department of Physics and Astronomy,<br>
University of Victoria (<a href="http://astrowww.phys.uvic.ca" target="_blank">astrowww.phys.uvic.ca</a>).<br>
<br>
Programming affiliations with the FreeEOS equation-of-state implementation<br>
for stellar interiors (<a href="http://freeeos.sf.net" target="_blank">freeeos.sf.net</a>); PLplot scientific plotting software<br>
package (<a href="http://plplot.org" target="_blank">plplot.org</a>); the libLASi project (<a href="http://unifont.org/lasi" target="_blank">unifont.org/lasi</a>); the Loads of<br>
Linux Links project (<a href="http://loll.sf.net" target="_blank">loll.sf.net</a>); and the Linux Brochure Project<br>
(<a href="http://lbproject.sf.net" target="_blank">lbproject.sf.net</a>).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<br>
<br>
</blockquote></div><br>