OCaml and CMake

William A. Hoffman billlist at nycap.rr.com
Tue Mar 28 15:39:59 CEST 2006


At 05:47 AM 3/28/2006, Carsten Niehaus wrote:
>Hi
>
>Kalzium of KDE 3.5 supports a solver for chemical equations. The solver is 
>written by Thomas Nagy in OCaml. AFAIK (and google tells me) CMake does not 
>support OCaml right now. Unsermake/autotools didn't support it either, so we 
>created a static Makefile (attached) which worked on most systems and the 
>following ugly configure.in-check.
>I would now like to activate OCaml in Kalzium but have not the slightest idea 
>how to do that...
>
>Carsten


It maybe possible to add support for OCaml to CMake with a few cmake files.
Can you tell me how the OCaml compiler works.   Basically, show me these steps;

1. compile a single file, what is the input extension and output extension
2. combine output files into static/shared library
3. combine output files and libraries into an executable

For an example, you can see how the java support works:

In the modules directory, there are these files for java support:

CMakeDetermineJavaCompiler.cmake  // find the compiler and tools
CMakeJavaInformation.cmake   // provide production rules for compiling
CMakeJavaCompiler.cmake.in   // store the compiler and tools
CMakeTestJavaCompiler.cmake  // test the compiler and tools

Then in the project command you list the name.

So, it would be
CMakeDetermineOCamlCompiler.cmake  and project(OCaml), and so on.

If OCaml will fit this model, I can help you create the files.

-Bill



More information about the Kde-buildsystem mailing list