[PATCH] D24354: cmake: Install the OCaml libraries into a more correct path

Michał Górny via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 03:16:50 PDT 2016


mgorny updated the summary for this revision.
mgorny updated this revision to Diff 70803.
mgorny added a comment.

Hopefully this one would be 100% good ;-). Now the top directory is being configured, and META.* files are installed there. The libraries are installed unconditionally in "llvm" subdirectory, and it is also specified in META.* files.

I've tested this patch properly, and can confirm that ocamlfind sees all LLVM packages.


https://reviews.llvm.org/D24354

Files:
  bindings/ocaml/CMakeLists.txt
  bindings/ocaml/backends/CMakeLists.txt
  bindings/ocaml/backends/META.llvm_backend.in
  bindings/ocaml/llvm/CMakeLists.txt
  bindings/ocaml/llvm/META.llvm.in
  cmake/modules/AddOCaml.cmake

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)
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: 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/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_ at TARGET@.cma"
 archive(native) = "llvm_ at TARGET@.cmxa"
-directory = "."
+directory = "llvm"
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/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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24354.70803.patch
Type: text/x-patch
Size: 2703 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160909/bd7496f0/attachment.bin>


More information about the llvm-commits mailing list