Michael Gottesman | 5b83d0c | 2013-08-24 07:25:21 +0000 | [diff] [blame] | 1 | |
Michael Gottesman | 5b83d0c | 2013-08-24 07:25:21 +0000 | [diff] [blame] | 2 | if (DOXYGEN_FOUND) |
| 3 | if (LLVM_ENABLE_DOXYGEN) |
| 4 | set(abs_top_srcdir ${LLVM_MAIN_SRC_DIR}) |
| 5 | set(abs_top_builddir ${LLVM_BINARY_DIR}) |
| 6 | |
| 7 | if (HAVE_DOT) |
| 8 | set(DOT ${LLVM_PATH_DOT}) |
| 9 | endif() |
Michael Gottesman | 1800b66 | 2013-08-28 20:28:35 +0000 | [diff] [blame^] | 10 | |
| 11 | if (DOXYGEN_EXTERNAL_SEARCH) |
| 12 | set(SEARCHENGINE "YES") |
| 13 | set(SERVER_BASED_SEARCH "YES") |
| 14 | set(EXTERNAL_SEARCH "YES") |
| 15 | |
| 16 | set(EXTRA_SEARCH_MAPPINGS "") |
| 17 | foreach(NameAndValue ${DOXYGEN_SEARCH_MAPPINGS}) |
| 18 | # Strip leading spaces |
| 19 | string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue}) |
| 20 | # Find variable name |
| 21 | string(REGEX MATCH "^[^=]+" Name ${NameAndValue}) |
| 22 | # Find the value |
| 23 | string(REPLACE "${Name}=" "" Value ${NameAndValue}) |
| 24 | # Set the variable |
| 25 | if (NOT ${Name} EQUALS llvm) |
| 26 | set(EXTRA_SEARCH_MAPPINGS "${EXTRA_SEARCH_MAPPINGS} ${LLVM_BINARY_DIR}/${NameAndValue}") |
| 27 | endif() |
| 28 | endforeach() |
| 29 | else() |
| 30 | set(SEARCHENGINE "NO") |
| 31 | set(SERVER_BASED_SEARCH "NO") |
| 32 | set(EXTERNAL_SEARCH "NO") |
| 33 | set(EXTRA_SEARCH_MAPPINGS "") |
| 34 | endif() |
Michael Gottesman | 5b83d0c | 2013-08-24 07:25:21 +0000 | [diff] [blame] | 35 | |
| 36 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in |
| 37 | ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY) |
| 38 | set(abs_top_srcdir) |
| 39 | set(abs_top_builddir) |
| 40 | set(DOT) |
| 41 | |
Michael Gottesman | b7cb635 | 2013-08-28 20:28:32 +0000 | [diff] [blame] | 42 | add_custom_target(doxygen-llvm |
Michael Gottesman | 5b83d0c | 2013-08-24 07:25:21 +0000 | [diff] [blame] | 43 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg |
| 44 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
Michael Gottesman | b7cb635 | 2013-08-28 20:28:32 +0000 | [diff] [blame] | 45 | COMMENT "Generating llvm doxygen documentation." VERBATIM) |
| 46 | |
| 47 | if (LLVM_BUILD_DOCS) |
| 48 | add_dependencies(doxygen doxygen-llvm) |
| 49 | endif() |
Michael Gottesman | 5b83d0c | 2013-08-24 07:25:21 +0000 | [diff] [blame] | 50 | |
| 51 | if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) |
| 52 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html |
| 53 | DESTINATION docs/html) |
| 54 | endif() |
| 55 | endif() |
| 56 | endif() |