blob: 7e9cc6beeab5a7e51d90f2b0cf755188df092d75 [file] [log] [blame]
Michael Gottesman5b83d0c2013-08-24 07:25:21 +00001
Michael Gottesman5b83d0c2013-08-24 07:25:21 +00002if (DOXYGEN_FOUND)
3if (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 Gottesman1800b662013-08-28 20:28:35 +000010
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 Gottesman5b83d0c2013-08-24 07:25:21 +000035
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 Gottesmanb7cb6352013-08-28 20:28:32 +000042 add_custom_target(doxygen-llvm
Michael Gottesman5b83d0c2013-08-24 07:25:21 +000043 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
44 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Michael Gottesmanb7cb6352013-08-28 20:28:32 +000045 COMMENT "Generating llvm doxygen documentation." VERBATIM)
46
47 if (LLVM_BUILD_DOCS)
48 add_dependencies(doxygen doxygen-llvm)
49 endif()
Michael Gottesman5b83d0c2013-08-24 07:25:21 +000050
51 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
52 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
53 DESTINATION docs/html)
54 endif()
55endif()
56endif()