WARNING: Right now the patch doesn't work and this error is raised: `get_target_property() called with non-existent target "LLVM".`. Does anybody know why ?
The problem:
If OCaml is not installed in the same tree as LLVM (e.g. with OPAM), the build script doesn't work. Moreover, if SHARED_LIBS is enabled, the resulting binding won't be dynamically linked.
Here is a patch that tries to fix these two issues.
The patch also fixes the build instructions.
I also tried to allow both static and shared libraries if possible (see OPAM package) but my level of comprehension of CMake is quite limited so I gave up. But if anybody have any idea how to do that better, please feel free to discuss this matter here.
You've removed the foreach loop, so llvm_lib is not defined here.