[CMake] OCaml support in CMake?

Judicaël Bedouet j.bedouet at infonie.fr
Wed Mar 10 14:56:58 EST 2010


Hello,

I'm currently working on scripts to manage OCaml libraries and executables
in CMake. It's just a set of scripts. I wonder if they could be integrated
in the CMake distribution or if it would be better to integrate a real OCaml
support in CMake. (I'm not in the CMake team)

I have sent two versions of my scripts to Keyan. The first version is
integrated in his project, it's sufficient for him but it remains a lot of
bugs in it. I'm waiting for him to test the second version.

Native or bytecode targets are managed. OCaml dependencies also (not exactly
as I would like to manage them) but they are managed. Build is parallel
safe. I have started to integrate C libraries. Otherwise, using my scripts
looks like


cmake_minimum_required (VERSION 2.6)
project (analysis NONE)

find_package (OCaml REQUIRED)
include (UseOCaml)

find_ocaml_package (extlib)

include_directories (${EXTLIB_INCLUDE_DIRS})

add_ocaml_library (common
  SOURCES   message node files
  LIBRARIES Unix Str ${EXTLIB_LIBRARIES}
  )

add_ocaml_executable (loc
  SOURCES statistics.mli statistics.ml loc.ml
  LIBRARIES common
  )

install_ocaml_targets (common DESTINATION lib/ocaml/site-lib/analysis)
install_ocaml_interfaces (common DESTINATION lib/ocaml/site-lib/analysis)


J. Bedouet


---------- Forwarded message ----------
From: Magnus Therning <magnus at therning.org>
To: cmake at cmake.org
Date: Wed, 10 Mar 2010 12:35:57 +0000
Subject: [CMake] OCaml support in CMake?
I'm completely new to CMake, even though I've heard of it before this
is the first time I have a closer look at it.  Actually this was
prompted by the interview in FLOSS Weekly :-)

Currently I have a rather large OCaml project, which uses OMake.
There are several things I'd like to improve on the build system, the
most pressing being to add generation of RPMs.  CMake seems to offer
some very compelling improvements over OMake, including built-in
support for generating RPMs :-)

I found a discussion on this mailing list from January this year on
adding OCaml support[1], but that seems to have died out without any
clear resolution.  I also had a quick look at the CMake source tree
and found no mention of OCaml among the file names.

What is the current state of OCaml support in CMake?

If it's still non-existent what options do I have?  (I should probably
make clear that I'd *really* want to avoid having to write any macros
myself.  Using macros copied from some other project would be much
better ;-)

/M

[1]: http://www.mail-archive.com/cmake@cmake.org/msg26809.html

--
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100310/cd92fdc2/attachment.htm>


More information about the CMake mailing list