blob: 8528c7af584096b48f88b82b9b266a98fcd1880a [file] [log] [blame]
Michael Gottesman1ab6c6c2013-08-28 20:29:40 +00001
2if (DOXYGEN_FOUND)
3if (LLVM_ENABLE_DOXYGEN)
Michael Gottesman855baa62013-08-28 20:29:44 +00004 set(abs_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
Michael Gottesman44d971c2013-08-28 21:55:41 +00005 set(abs_builddir ${CMAKE_CURRENT_BINARY_DIR})
Michael Gottesman1ab6c6c2013-08-28 20:29:40 +00006
7 if (HAVE_DOT)
8 set(DOT ${LLVM_PATH_DOT})
9 endif()
10
Michael Gottesman44d971c2013-08-28 21:55:41 +000011 if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
12 set(enable_searchengine "YES")
13 set(searchengine_url "${LLVM_DOXYGEN_SEARCHENGINE_URL}")
14 set(enable_server_based_search "YES")
15 set(enable_external_search "YES")
16 set(extra_search_mappings "${LLVM_DOXYGEN_SEARCH_MAPPINGS}")
Michael Gottesman855baa62013-08-28 20:29:44 +000017 else()
Michael Gottesman44d971c2013-08-28 21:55:41 +000018 set(enable_searchengine "NO")
19 set(searchengine_url "")
20 set(enable_server_based_search "NO")
21 set(enable_external_search "NO")
22 set(extra_search_mappings "")
Michael Gottesman855baa62013-08-28 20:29:44 +000023 endif()
24
Michael Gottesman1ab6c6c2013-08-28 20:29:40 +000025 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
26 ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)
Michael Gottesman44d971c2013-08-28 21:55:41 +000027
28 set(abs_top_srcdir)
29 set(abs_top_builddir)
Michael Gottesman1ab6c6c2013-08-28 20:29:40 +000030 set(DOT)
Michael Gottesman44d971c2013-08-28 21:55:41 +000031 set(enable_searchengine)
32 set(searchengine_url)
33 set(enable_server_based_search)
34 set(enable_external_search)
35 set(extra_search_mappings)
Michael Gottesman1ab6c6c2013-08-28 20:29:40 +000036
37 add_custom_target(doxygen-clang
38 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
39 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
40 COMMENT "Generating clang doxygen documentation." VERBATIM)
41
42 if (LLVM_BUILD_DOCS)
43 add_dependencies(doxygen doxygen-clang)
44 endif()
45
46 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
47 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html
48 DESTINATION docs/html)
49 endif()
50endif()
51endif()