1f4a2713aSLionel Sambuc 2f4a2713aSLionel Sambucif (DOXYGEN_FOUND) 3f4a2713aSLionel Sambucif (LLVM_ENABLE_DOXYGEN) 4f4a2713aSLionel Sambuc set(abs_srcdir ${CMAKE_CURRENT_SOURCE_DIR}) 5f4a2713aSLionel Sambuc set(abs_builddir ${CMAKE_CURRENT_BINARY_DIR}) 6f4a2713aSLionel Sambuc 7f4a2713aSLionel Sambuc if (HAVE_DOT) 8f4a2713aSLionel Sambuc set(DOT ${LLVM_PATH_DOT}) 9f4a2713aSLionel Sambuc endif() 10f4a2713aSLionel Sambuc 11f4a2713aSLionel Sambuc if (LLVM_DOXYGEN_EXTERNAL_SEARCH) 12f4a2713aSLionel Sambuc set(enable_searchengine "YES") 13f4a2713aSLionel Sambuc set(searchengine_url "${LLVM_DOXYGEN_SEARCHENGINE_URL}") 14f4a2713aSLionel Sambuc set(enable_server_based_search "YES") 15f4a2713aSLionel Sambuc set(enable_external_search "YES") 16f4a2713aSLionel Sambuc set(extra_search_mappings "${LLVM_DOXYGEN_SEARCH_MAPPINGS}") 17f4a2713aSLionel Sambuc else() 18f4a2713aSLionel Sambuc set(enable_searchengine "NO") 19f4a2713aSLionel Sambuc set(searchengine_url "") 20f4a2713aSLionel Sambuc set(enable_server_based_search "NO") 21f4a2713aSLionel Sambuc set(enable_external_search "NO") 22f4a2713aSLionel Sambuc set(extra_search_mappings "") 23f4a2713aSLionel Sambuc endif() 24f4a2713aSLionel Sambuc 25*0a6a1f1dSLionel Sambuc # If asked, configure doxygen for the creation of a Qt Compressed Help file. 26*0a6a1f1dSLionel Sambuc if (LLVM_ENABLE_DOXYGEN_QT_HELP) 27*0a6a1f1dSLionel Sambuc set(CLANG_DOXYGEN_QCH_FILENAME "org.llvm.clang.qch" CACHE STRING 28*0a6a1f1dSLionel Sambuc "Filename of the Qt Compressed help file") 29*0a6a1f1dSLionel Sambuc set(CLANG_DOXYGEN_QHP_NAMESPACE "org.llvm.clang" CACHE STRING 30*0a6a1f1dSLionel Sambuc "Namespace under which the intermediate Qt Help Project file lives") 31*0a6a1f1dSLionel Sambuc set(CLANG_DOXYGEN_QHP_CUST_FILTER_NAME "Clang ${CLANG_VERSION}" CACHE STRING 32*0a6a1f1dSLionel Sambuc "See http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-filters") 33*0a6a1f1dSLionel Sambuc set(CLANG_DOXYGEN_QHP_CUST_FILTER_ATTRS "Clang,${CLANG_VERSION}" CACHE STRING 34*0a6a1f1dSLionel Sambuc "See http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes") 35*0a6a1f1dSLionel Sambuc set(clang_doxygen_generate_qhp "YES") 36*0a6a1f1dSLionel Sambuc set(clang_doxygen_qch_filename "${CLANG_DOXYGEN_QCH_FILENAME}") 37*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_namespace "${CLANG_DOXYGEN_QHP_NAMESPACE}") 38*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhelpgenerator_path "${LLVM_DOXYGEN_QHELPGENERATOR_PATH}") 39*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_cust_filter_name "${CLANG_DOXYGEN_QHP_CUST_FILTER_NAME}") 40*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_cust_filter_attrs "${CLANG_DOXYGEN_QHP_CUST_FILTER_ATTRS}") 41*0a6a1f1dSLionel Sambuc else() 42*0a6a1f1dSLionel Sambuc set(clang_doxygen_generate_qhp "NO") 43*0a6a1f1dSLionel Sambuc set(clang_doxygen_qch_filename "") 44*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_namespace "") 45*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhelpgenerator_path "") 46*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_cust_filter_name "") 47*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_cust_filter_attrs "") 48*0a6a1f1dSLionel Sambuc endif() 49*0a6a1f1dSLionel Sambuc 50f4a2713aSLionel Sambuc configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in 51f4a2713aSLionel Sambuc ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY) 52f4a2713aSLionel Sambuc 53f4a2713aSLionel Sambuc set(abs_top_srcdir) 54f4a2713aSLionel Sambuc set(abs_top_builddir) 55f4a2713aSLionel Sambuc set(DOT) 56f4a2713aSLionel Sambuc set(enable_searchengine) 57f4a2713aSLionel Sambuc set(searchengine_url) 58f4a2713aSLionel Sambuc set(enable_server_based_search) 59f4a2713aSLionel Sambuc set(enable_external_search) 60f4a2713aSLionel Sambuc set(extra_search_mappings) 61*0a6a1f1dSLionel Sambuc set(clang_doxygen_generate_qhp) 62*0a6a1f1dSLionel Sambuc set(clang_doxygen_qch_filename) 63*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_namespace) 64*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhelpgenerator_path) 65*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_cust_filter_name) 66*0a6a1f1dSLionel Sambuc set(clang_doxygen_qhp_cust_filter_attrs) 67f4a2713aSLionel Sambuc 68f4a2713aSLionel Sambuc add_custom_target(doxygen-clang 69f4a2713aSLionel Sambuc COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg 70f4a2713aSLionel Sambuc WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 71f4a2713aSLionel Sambuc COMMENT "Generating clang doxygen documentation." VERBATIM) 72f4a2713aSLionel Sambuc 73f4a2713aSLionel Sambuc if (LLVM_BUILD_DOCS) 74f4a2713aSLionel Sambuc add_dependencies(doxygen doxygen-clang) 75f4a2713aSLionel Sambuc endif() 76f4a2713aSLionel Sambuc 77f4a2713aSLionel Sambuc if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) 78f4a2713aSLionel Sambuc install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html 79f4a2713aSLionel Sambuc DESTINATION docs/html) 80f4a2713aSLionel Sambuc endif() 81f4a2713aSLionel Sambucendif() 82f4a2713aSLionel Sambucendif() 83*0a6a1f1dSLionel Sambuc 84*0a6a1f1dSLionel Sambucif (LLVM_ENABLE_SPHINX) 85*0a6a1f1dSLionel Sambuc if (SPHINX_FOUND) 86*0a6a1f1dSLionel Sambuc include(AddSphinxTarget) 87*0a6a1f1dSLionel Sambuc if (${SPHINX_OUTPUT_HTML}) 88*0a6a1f1dSLionel Sambuc add_sphinx_target(html clang) 89*0a6a1f1dSLionel Sambuc endif() 90*0a6a1f1dSLionel Sambuc endif() 91*0a6a1f1dSLionel Sambucendif() 92