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()