forked from OSchip/llvm-project
[autotools->cmake] Enable generation of doxygen documentation via cmake.
I am going to add in a subsequent patch support for generating the llvm manpage. llvm-svn: 189164
This commit is contained in:
parent
6c20dde756
commit
4d35b909ad
|
@ -231,6 +231,10 @@ option(LLVM_BUILD_TESTS
|
||||||
"Build LLVM unit tests. If OFF, just generate build targets." OFF)
|
"Build LLVM unit tests. If OFF, just generate build targets." OFF)
|
||||||
option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
|
option(LLVM_INCLUDE_TESTS "Generate build targets for the LLVM unit tests." ON)
|
||||||
|
|
||||||
|
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 documentation." OFF)
|
||||||
|
|
||||||
# All options referred to from HandleLLVMOptions have to be specified
|
# All options referred to from HandleLLVMOptions have to be specified
|
||||||
# BEFORE this include, otherwise options will not be correctly set on
|
# BEFORE this include, otherwise options will not be correctly set on
|
||||||
# first cmake run
|
# first cmake run
|
||||||
|
@ -465,6 +469,10 @@ if( LLVM_INCLUDE_TESTS )
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (LLVM_INCLUDE_DOCS)
|
||||||
|
add_subdirectory(docs)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(cmake/modules)
|
add_subdirectory(cmake/modules)
|
||||||
|
|
||||||
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||||
|
@ -497,8 +505,6 @@ if( NOT WIN32 )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# TODO: make and install documentation.
|
|
||||||
|
|
||||||
set(CPACK_PACKAGE_VENDOR "LLVM")
|
set(CPACK_PACKAGE_VENDOR "LLVM")
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
|
set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR})
|
set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR})
|
||||||
|
|
|
@ -460,3 +460,10 @@ if (LLVM_ENABLE_ZLIB )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(LLVM_PREFIX ${CMAKE_INSTALL_PREFIX})
|
set(LLVM_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||||
|
|
||||||
|
if (LLVM_ENABLE_DOXYGEN)
|
||||||
|
message(STATUS "Doxygen enabled.")
|
||||||
|
find_package(Doxygen)
|
||||||
|
else()
|
||||||
|
message(STATUS "Doxygen disabled.")
|
||||||
|
endif()
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
if (LLVM_BUILD_DOCS)
|
||||||
|
set(LLVM_DOCS_ADD_TO_ALL ALL)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (DOXYGEN_FOUND)
|
||||||
|
if (LLVM_ENABLE_DOXYGEN)
|
||||||
|
set(abs_top_srcdir ${LLVM_MAIN_SRC_DIR})
|
||||||
|
set(abs_top_builddir ${LLVM_BINARY_DIR})
|
||||||
|
|
||||||
|
if (HAVE_DOT)
|
||||||
|
set(DOT ${LLVM_PATH_DOT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)
|
||||||
|
set(abs_top_srcdir)
|
||||||
|
set(abs_top_builddir)
|
||||||
|
set(DOT)
|
||||||
|
|
||||||
|
add_custom_target(doxygen ${LLVM_DOCS_ADD_TO_ALL}
|
||||||
|
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
COMMENT "Generating doxygen documentation." VERBATIM)
|
||||||
|
|
||||||
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
||||||
|
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
|
||||||
|
DESTINATION docs/html)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
Loading…
Reference in New Issue