Index: bindings/ocaml/CMakeLists.txt =================================================================== --- bindings/ocaml/CMakeLists.txt +++ bindings/ocaml/CMakeLists.txt @@ -1,3 +1,6 @@ +set(LLVM_OCAML_INSTALL_PATH "${OCAML_STDLIB_PATH}" CACHE STRING + "Install directory for LLVM Ocaml packages") + add_subdirectory(llvm) add_subdirectory(all_backends) add_subdirectory(analysis) Index: bindings/ocaml/backends/CMakeLists.txt =================================================================== --- bindings/ocaml/backends/CMakeLists.txt +++ bindings/ocaml/backends/CMakeLists.txt @@ -23,5 +23,5 @@ "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}") install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm_${TARGET}" - DESTINATION lib/ocaml) + DESTINATION "${LLVM_OCAML_INSTALL_PATH}") endforeach() Index: bindings/ocaml/backends/META.llvm_backend.in =================================================================== --- bindings/ocaml/backends/META.llvm_backend.in +++ bindings/ocaml/backends/META.llvm_backend.in @@ -4,4 +4,4 @@ requires = "llvm" archive(byte) = "llvm_@TARGET@.cma" archive(native) = "llvm_@TARGET@.cmxa" -directory = "." +directory = "llvm" Index: bindings/ocaml/llvm/CMakeLists.txt =================================================================== --- bindings/ocaml/llvm/CMakeLists.txt +++ bindings/ocaml/llvm/CMakeLists.txt @@ -8,4 +8,4 @@ "${LLVM_LIBRARY_DIR}/ocaml/META.llvm") install(FILES "${LLVM_LIBRARY_DIR}/ocaml/META.llvm" - DESTINATION lib/ocaml) + DESTINATION "${LLVM_OCAML_INSTALL_PATH}") Index: bindings/ocaml/llvm/META.llvm.in =================================================================== --- bindings/ocaml/llvm/META.llvm.in +++ bindings/ocaml/llvm/META.llvm.in @@ -3,7 +3,7 @@ description = "LLVM OCaml bindings" archive(byte) = "llvm.cma" archive(native) = "llvm.cmxa" -directory = "." +directory = "llvm" package "analysis" ( requires = "llvm" Index: cmake/modules/AddOCaml.cmake =================================================================== --- cmake/modules/AddOCaml.cmake +++ cmake/modules/AddOCaml.cmake @@ -193,12 +193,12 @@ endforeach() install(FILES ${install_files} - DESTINATION lib/ocaml) + DESTINATION "${LLVM_OCAML_INSTALL_PATH}/llvm") install(FILES ${install_shlibs} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - DESTINATION lib/ocaml) + DESTINATION "${LLVM_OCAML_INSTALL_PATH}/llvm") foreach( install_file ${install_files} ${install_shlibs} ) get_filename_component(filename "${install_file}" NAME)