0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 if (DOXYGEN_FOUND)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 if (LLVM_ENABLE_DOXYGEN)
|
121
|
4 set(abs_top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
|
|
5 set(abs_top_builddir ${CMAKE_CURRENT_BINARY_DIR})
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 if (HAVE_DOT)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 set(DOT ${LLVM_PATH_DOT})
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 endif()
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 set(enable_searchengine "YES")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 set(searchengine_url "${LLVM_DOXYGEN_SEARCHENGINE_URL}")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 set(enable_server_based_search "YES")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 set(enable_external_search "YES")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 set(extra_search_mappings "${LLVM_DOXYGEN_SEARCH_MAPPINGS}")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 else()
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 set(enable_searchengine "NO")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 set(searchengine_url "")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 set(enable_server_based_search "NO")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 set(enable_external_search "NO")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 set(extra_search_mappings "")
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 endif()
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24
|
77
|
25 # If asked, configure doxygen for the creation of a Qt Compressed Help file.
|
|
26 option(LLVM_ENABLE_DOXYGEN_QT_HELP
|
|
27 "Generate a Qt Compressed Help file." OFF)
|
|
28 if (LLVM_ENABLE_DOXYGEN_QT_HELP)
|
|
29 set(LLVM_DOXYGEN_QCH_FILENAME "org.llvm.qch" CACHE STRING
|
|
30 "Filename of the Qt Compressed help file")
|
|
31 set(LLVM_DOXYGEN_QHP_NAMESPACE "org.llvm" CACHE STRING
|
|
32 "Namespace under which the intermediate Qt Help Project file lives")
|
|
33 set(LLVM_DOXYGEN_QHP_CUST_FILTER_NAME "${PACKAGE_STRING}" CACHE STRING
|
|
34 "See http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-filters")
|
|
35 set(LLVM_DOXYGEN_QHP_CUST_FILTER_ATTRS "${PACKAGE_NAME},${PACKAGE_VERSION}" CACHE STRING
|
|
36 "See http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes")
|
|
37 find_program(LLVM_DOXYGEN_QHELPGENERATOR_PATH qhelpgenerator
|
|
38 DOC "Path to the qhelpgenerator binary")
|
|
39 if (NOT LLVM_DOXYGEN_QHELPGENERATOR_PATH)
|
|
40 message(FATAL_ERROR "Failed to find qhelpgenerator binary")
|
|
41 endif()
|
|
42
|
|
43 set(llvm_doxygen_generate_qhp "YES")
|
|
44 set(llvm_doxygen_qch_filename "${LLVM_DOXYGEN_QCH_FILENAME}")
|
|
45 set(llvm_doxygen_qhp_namespace "${LLVM_DOXYGEN_QHP_NAMESPACE}")
|
|
46 set(llvm_doxygen_qhelpgenerator_path "${LLVM_DOXYGEN_QHELPGENERATOR_PATH}")
|
|
47 set(llvm_doxygen_qhp_cust_filter_name "${LLVM_DOXYGEN_QHP_CUST_FILTER_NAME}")
|
|
48 set(llvm_doxygen_qhp_cust_filter_attrs "${LLVM_DOXYGEN_QHP_CUST_FILTER_ATTRS}")
|
|
49
|
|
50 else()
|
|
51 set(llvm_doxygen_generate_qhp "NO")
|
|
52 set(llvm_doxygen_qch_filename "")
|
|
53 set(llvm_doxygen_qhp_namespace "")
|
|
54 set(llvm_doxygen_qhelpgenerator_path "")
|
|
55 set(llvm_doxygen_qhp_cust_filter_name "")
|
|
56 set(llvm_doxygen_qhp_cust_filter_attrs "")
|
|
57 endif()
|
|
58
|
95
|
59 option(LLVM_DOXYGEN_SVG
|
|
60 "Use svg instead of png files for doxygen graphs." OFF)
|
|
61 if (LLVM_DOXYGEN_SVG)
|
|
62 set(DOT_IMAGE_FORMAT "svg")
|
|
63 else()
|
|
64 set(DOT_IMAGE_FORMAT "png")
|
|
65 endif()
|
|
66
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 set(abs_top_srcdir)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 set(abs_top_builddir)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 set(DOT)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 set(enable_searchengine)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 set(searchengine_url)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 set(enable_server_based_search)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 set(enable_external_search)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 set(extra_search_mappings)
|
77
|
78 set(llvm_doxygen_generate_qhp)
|
|
79 set(llvm_doxygen_qch_filename)
|
|
80 set(llvm_doxygen_qhp_namespace)
|
|
81 set(llvm_doxygen_qhelpgenerator_path)
|
|
82 set(llvm_doxygen_qhp_cust_filter_name)
|
|
83 set(llvm_doxygen_qhp_cust_filter_attrs)
|
95
|
84 set(DOT_IMAGE_FORMAT)
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 add_custom_target(doxygen-llvm
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 COMMENT "Generating llvm doxygen documentation." VERBATIM)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 if (LLVM_BUILD_DOCS)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 add_dependencies(doxygen doxygen-llvm)
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 endif()
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
120
|
96 # ./ suffix is needed to copy the contents of html directory without
|
|
97 # appending html/ into LLVM_INSTALL_DOXYGEN_HTML_DIR.
|
|
98 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen/html/.
|
|
99 COMPONENT doxygen-html
|
|
100 DESTINATION "${LLVM_INSTALL_DOXYGEN_HTML_DIR}")
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 endif()
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 endif()
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 endif()
|
77
|
104
|
|
105 if (LLVM_ENABLE_SPHINX)
|
121
|
106 include(AddSphinxTarget)
|
77
|
107 if (SPHINX_FOUND)
|
|
108 if (${SPHINX_OUTPUT_HTML})
|
|
109 add_sphinx_target(html llvm)
|
|
110 endif()
|
|
111
|
|
112
|
|
113 if (${SPHINX_OUTPUT_MAN})
|
|
114 add_sphinx_target(man llvm)
|
121
|
115 add_sphinx_target(man llvm-dwarfdump)
|
77
|
116 endif()
|
|
117
|
|
118 endif()
|
|
119 endif()
|
83
|
120
|
|
121 list(FIND LLVM_BINDINGS_LIST ocaml uses_ocaml)
|
120
|
122 if( NOT uses_ocaml LESS 0 AND LLVM_ENABLE_OCAMLDOC )
|
83
|
123 set(doc_targets
|
|
124 ocaml_llvm
|
|
125 ocaml_llvm_all_backends
|
|
126 ocaml_llvm_analysis
|
|
127 ocaml_llvm_bitreader
|
|
128 ocaml_llvm_bitwriter
|
|
129 ocaml_llvm_executionengine
|
|
130 ocaml_llvm_irreader
|
|
131 ocaml_llvm_linker
|
|
132 ocaml_llvm_target
|
|
133 ocaml_llvm_ipo
|
|
134 ocaml_llvm_passmgr_builder
|
|
135 ocaml_llvm_scalar_opts
|
|
136 ocaml_llvm_transform_utils
|
|
137 ocaml_llvm_vectorize
|
|
138 )
|
|
139
|
|
140 foreach(llvm_target ${LLVM_TARGETS_TO_BUILD})
|
|
141 list(APPEND doc_targets ocaml_llvm_${llvm_target})
|
|
142 endforeach()
|
|
143
|
|
144 set(odoc_files)
|
|
145 foreach( doc_target ${doc_targets} )
|
|
146 get_target_property(odoc_file ${doc_target} OCAML_ODOC)
|
|
147 list(APPEND odoc_files -load ${odoc_file})
|
|
148 endforeach()
|
|
149
|
|
150 add_custom_target(ocaml_doc
|
|
151 COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html
|
|
152 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html
|
|
153 COMMAND ${OCAMLFIND} ocamldoc -d ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html
|
95
|
154 -sort -colorize-code -html ${odoc_files}
|
|
155 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/_ocamldoc/style.css
|
|
156 ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html)
|
83
|
157
|
|
158 add_dependencies(ocaml_doc ${doc_targets})
|
|
159
|
|
160 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
120
|
161 # ./ suffix is needed to copy the contents of html directory without
|
|
162 # appending html/ into LLVM_INSTALL_OCAMLDOC_HTML_DIR.
|
|
163 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html/.
|
|
164 COMPONENT ocamldoc-html
|
|
165 DESTINATION "${LLVM_INSTALL_OCAMLDOC_HTML_DIR}")
|
83
|
166 endif()
|
|
167 endif()
|