Skip to content

Commit

Permalink
[autotools->cmake] Enable generation of doxygen documentation via cmake.
Browse files Browse the repository at this point in the history
I am going to add in a subsequent patch support for generating the llvm
manpage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189164 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
gottesmm committed Aug 24, 2013
1 parent 4a48389 commit 5b83d0c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ option(LLVM_BUILD_TESTS
"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_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
# BEFORE this include, otherwise options will not be correctly set on
# first cmake run
Expand Down Expand Up @@ -465,6 +469,10 @@ if( LLVM_INCLUDE_TESTS )
)
endif()

if (LLVM_INCLUDE_DOCS)
add_subdirectory(docs)
endif()

add_subdirectory(cmake/modules)

if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
Expand Down Expand Up @@ -497,8 +505,6 @@ if( NOT WIN32 )
endif()


# TODO: make and install documentation.

set(CPACK_PACKAGE_VENDOR "LLVM")
set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR})
Expand Down
7 changes: 7 additions & 0 deletions cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -460,3 +460,10 @@ if (LLVM_ENABLE_ZLIB )
endif()

set(LLVM_PREFIX ${CMAKE_INSTALL_PREFIX})

if (LLVM_ENABLE_DOXYGEN)
message(STATUS "Doxygen enabled.")
find_package(Doxygen)
else()
message(STATUS "Doxygen disabled.")
endif()
31 changes: 31 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 5b83d0c

Please sign in to comment.