[PATCH] D23758: cmake: Support stand-alone Sphinx & doxygen doc build

Michał Górny via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 21 03:25:34 PDT 2016


mgorny created this revision.
mgorny added a reviewer: chapuni.
mgorny added a subscriber: cfe-commits.

Copy the necessary options and configuration checks from LLVM to clang,
to support stand-alone documentation builds.


https://reviews.llvm.org/D23758

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -162,6 +162,43 @@
     endif()
   endif()
 
+  option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
+  option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
+  option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
+  option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
+
+  if (LLVM_ENABLE_DOXYGEN)
+    message(STATUS "Doxygen enabled.")
+    find_package(Doxygen REQUIRED)
+
+    if (DOXYGEN_FOUND)
+      # If we find doxygen and we want to enable doxygen by default create a
+      # global aggregate doxygen target for generating llvm and any/all
+      # subprojects doxygen documentation.
+      if (LLVM_BUILD_DOCS)
+        add_custom_target(doxygen ALL)
+      endif()
+
+      option(LLVM_DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF)
+      if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
+        set(LLVM_DOXYGEN_SEARCHENGINE_URL "" CACHE STRING "URL to use for external search.")
+        set(LLVM_DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings")
+      endif()
+    endif()
+  else()
+    message(STATUS "Doxygen disabled.")
+  endif()
+
+  if (LLVM_ENABLE_SPHINX)
+    message(STATUS "Sphinx enabled.")
+    find_package(Sphinx REQUIRED)
+    if (LLVM_BUILD_DOCS)
+      add_custom_target(sphinx ALL)
+    endif()
+  else()
+    message(STATUS "Sphinx disabled.")
+  endif()
+
   set( CLANG_BUILT_STANDALONE 1 )
   set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}")
 else()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23758.68809.patch
Type: text/x-patch
Size: 1638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160821/3b50d3a4/attachment.bin>


More information about the cfe-commits mailing list