[CMake] Support for building of OCaml software?

SF Markus Elfring elfring at users.sourceforge.net
Sat Apr 19 12:25:37 EDT 2014


> If you want native executables, you can specify it in the CMakeLists for each target
> or set the option CMAKE_OCaml_NATIVE to TRUE.

Thanks for your clarification.


> If you mean .mli files, hopefully they are managed.

I would prefer to map the file name for the OCaml interface compiler also to a
CMake cache variable.


>> librarian (linker?)
> You can use the CMake GUI to change the variables CMAKE_OCaml_LINKER_FLAGS*.

I would prefer to map the file name for the OCaml archive generator also to
another CMake cache variable.

How do you think about to distinguish this program from other linking tools?


>> Would further checks be useful for tools like "as" (GNU assembler), "ar" and
> "ranlib" from the software package "binutils"?
> [...] Do you have an example where it is necessary ?

The software component "flexlink" (from "ocamlopt") depends on these tools.
http://alain.frisch.fr/flexdll.html#internals



How do you think about the addition of commands like "add_OCaml_executable" and
"add_OCaml_library"?
Do the additions from your CMake module work together with the command
"install(TARGETS ...)"?

Regards,
Markus


More information about the CMake mailing list