]> granicus.if.org Git - llvm/commitdiff
[llvm] [cmake] Add install targets for missing distribution components
authorMichal Gorny <mgorny@gentoo.org>
Wed, 2 Oct 2019 16:06:50 +0000 (16:06 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Wed, 2 Oct 2019 16:06:50 +0000 (16:06 +0000)
Add install targets as necessary to include all files normally installed
in LLVM_DISTRIBUTION_COMPONENTS.  This includes targets for Sphinx docs,
opt-viewer Python modules and TableGens.

Differential Revision: https://reviews.llvm.org/D68339

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373482 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/AddSphinxTarget.cmake
cmake/modules/TableGen.cmake
tools/opt-viewer/CMakeLists.txt

index 22e3dcb776aa222251d7e0310bfadba5e9358320..2bf654b60c444db4bc2fb900ae65d5eaccec00e8 100644 (file)
@@ -71,6 +71,11 @@ function (add_sphinx_target builder project)
                 COMPONENT "${project}-sphinx-man"
                 DESTINATION ${INSTALL_MANDIR}man1)
 
+        if(NOT LLVM_ENABLE_IDE)
+          add_llvm_install_targets("install-${SPHINX_TARGET_NAME}"
+                                   DEPENDS ${SPHINX_TARGET_NAME}
+                                   COMPONENT "${project}-sphinx-man")
+        endif()
       elseif (builder STREQUAL html)
         string(TOUPPER "${project}" project_upper)
         set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html"
@@ -82,6 +87,12 @@ function (add_sphinx_target builder project)
         install(DIRECTORY "${SPHINX_BUILD_DIR}/."
                 COMPONENT "${project}-sphinx-html"
                 DESTINATION "${${project_upper}_INSTALL_SPHINX_HTML_DIR}")
+
+        if(NOT LLVM_ENABLE_IDE)
+          add_llvm_install_targets("install-${SPHINX_TARGET_NAME}"
+                                   DEPENDS ${SPHINX_TARGET_NAME}
+                                   COMPONENT "${project}-sphinx-html")
+        endif()
       else()
         message(WARNING Installation of ${builder} not supported)
       endif()
index 71dfebb12b44f331af64f03eda247fed1f8a035c..38e755d6d15a25961e549c6ea7526f5af84f1bbe 100644 (file)
@@ -171,7 +171,13 @@ macro(add_tablegen target project)
 
     install(TARGETS ${target}
             ${export_to_llvmexports}
+            COMPONENT ${target}
             RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR})
+    if(NOT LLVM_ENABLE_IDE)
+      add_llvm_install_targets("install-${target}"
+                               DEPENDS ${target}
+                               COMPONENT ${target})
+    endif()
   endif()
   set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target})
 endmacro()
index 19b60693308201fbc0b530f6e92a1eddf725b1a3..ead73ec13a8f5d7e66d3cce11ba3c9603ec1d39e 100644 (file)
@@ -11,3 +11,10 @@ foreach (file ${files})
     DESTINATION share/opt-viewer
     COMPONENT opt-viewer)
 endforeach (file)
+
+add_custom_target(opt-viewer DEPENDS ${files})
+if(NOT LLVM_ENABLE_IDE)
+  add_llvm_install_targets("install-opt-viewer"
+                           DEPENDS opt-viewer
+                           COMPONENT opt-viewer)
+endif()