[CMake] Adding a new language

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Nov 14 15:24:24 EST 2011


On 2011-11-14 13:30-0500 Stefan Monnier wrote:

> I'd still like to know how to explain to cmake that the command produces
> 2 files, but at least I can get rid of my hack.

That (assuming just a simple object file is produced by compilation)
is one of several general limitations with CMake language support. For
example, my understanding is this issue has been taken care of for
Fortran 95 (where compilation produces both object and module files)
with Fortran-95 specific changes to the C++ cmake code.  But I would far
prefer to see a generic mechanism for this to not only to deal with
the Fortran 95 module issue, but also the compilation-generated Ada
library identification (*.ali) files, and also the similar issue for
OCaml compiler generated files that you have described.

Because of this and other struggles I had trying to implement Ada
language support for CMake, I didn't even consider implementing CMake
language support for OCaml for the PLplot OCaml bindings.  Instead we
currently use (many!) custom commands and targets for that case, but
I would be happy to change to your CMake OCaml language support
if/when that works.

Here is what I suggest you do to move forward with that project. 
Present a complete summary of your OCaml compilation needs for the
CMake developers.  That is, state what commands are used to build
libraries, what commands are used to build executables, what kinds of
files are generated for each stage of each kind of build, and what
directories need to be identified at each stage of the build to gain
access to files generated in previous stages of the build process.
Furthermore, a complicating factor with OCaml is there are two kinds
of executables (and libraries?) based on whether ocamlc or ocamlopt is
used to respectively produce bytecode executable files that are
executed with the OCaml interpreter (ocamlrun) or native executable
files that are executed with the ordinary run-time loader. If there
are different generic build needs for ocamlc versus ocamlopt be sure
to include those differences in your summary.

If you are willing to make such an OCaml summary, I would be willing
to do the same thing for Ada to make our joint case to the CMake
developers of what kind of additional generic language support is
needed by CMake to deal with the complicated build needs of languages
such as OCaml and Ada (and Fortran 95) in a completely generic way.

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); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); 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