[CMake] CMake & OCaml

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Aug 25 15:45:22 EDT 2010


On 2010-08-25 17:50+0200 Eric Noulard wrote:

> 2010/8/25 Magnus Therning <magnus at therning.org>:
>> A while ago I started looking at using CMake to build OCaml projects.  As part
>> of that I put together some useful (but maybe not very beautiful) macros.
>> They are available on github[1].
>>
>> I've come to the conclusion that while CMake is a rather good build tool, it
>> isn't very well designed to add full support for slightly esoteric languages
>> and tool chains like OCaml.
>
> I'm no OCaml expert but I'd like to know how you decided to build
> your OCaml project then?
> using ocamlbuild? custom makefiles ?
>
> May be you can give us here a the "main" 3 or so reasons
> you think CMake cannot handle OCaml project building.
>
> It may be useful for other not to go through the same path
> you did.

Look at my post (which crossed yours) for some of the ocaml issues we
encountered in the PLplot project.  In short, the detailed
custom-command/custom-target approach works, but many different kinds
of build commands are involved (much more than the "normal" compile
and link) in an ocaml build so the detailed approach is currently a
bad fit to be supported with the current CMake language support
infrastructure which is based on the idea of one configurable command
to link a library and one configurable command to build an executable.
It is possible somebody with knowledge of the internals of CMake could
change things around so that the configurable commands to build
libraries could be a whole set of detailed custom commands and targets
specified at the language support level. If such general language
support became available, I would certainly use if for OCaml and be
strongly tempted to change Ada language support from one based on
gnatmake (currently with not very satisfactory results) to one based
on a detailed set of custom commands that do the equivalent to
gnatmake using CMake custom commands.

Do the CMake developers here like the idea of this type of
generalization of the CMake language support?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list