How to get OCaml linker flags to link with C++ cmake build
问题 I'm trying to link some C++/cmake code with some OCaml code. If the C++ side were simple, I'd just add its object file to ocamlopt. If the OCaml side were simple, I'd add its object file to cmake. But they're both complex programs with lots of dependencies. Currently, I have it working, but it's a bit of a hack: I run ocamlopt -output-obj to get the main OCaml object: add_custom_command( OUTPUT ocaml_main.o DEPENDS ocaml.ml COMMAND ocamlfind ocamlopt -package mylib -linkpkg -output-obj -o