Lines 114-158
Link Here
|
114 |
endif() |
114 |
endif() |
115 |
endif() |
115 |
endif() |
116 |
|
116 |
|
117 |
list(FIND LLVM_BINDINGS_LIST ocaml uses_ocaml) |
117 |
if(LLVM_ENABLE_OCAMLDOC) |
118 |
if( NOT uses_ocaml LESS 0 ) |
118 |
list(FIND LLVM_BINDINGS_LIST ocaml uses_ocaml) |
119 |
set(doc_targets |
119 |
if( NOT uses_ocaml LESS 0 ) |
120 |
ocaml_llvm |
120 |
set(doc_targets |
121 |
ocaml_llvm_all_backends |
121 |
ocaml_llvm |
122 |
ocaml_llvm_analysis |
122 |
ocaml_llvm_all_backends |
123 |
ocaml_llvm_bitreader |
123 |
ocaml_llvm_analysis |
124 |
ocaml_llvm_bitwriter |
124 |
ocaml_llvm_bitreader |
125 |
ocaml_llvm_executionengine |
125 |
ocaml_llvm_bitwriter |
126 |
ocaml_llvm_irreader |
126 |
ocaml_llvm_executionengine |
127 |
ocaml_llvm_linker |
127 |
ocaml_llvm_irreader |
128 |
ocaml_llvm_target |
128 |
ocaml_llvm_linker |
129 |
ocaml_llvm_ipo |
129 |
ocaml_llvm_target |
130 |
ocaml_llvm_passmgr_builder |
130 |
ocaml_llvm_ipo |
131 |
ocaml_llvm_scalar_opts |
131 |
ocaml_llvm_passmgr_builder |
132 |
ocaml_llvm_transform_utils |
132 |
ocaml_llvm_scalar_opts |
133 |
ocaml_llvm_vectorize |
133 |
ocaml_llvm_transform_utils |
134 |
) |
134 |
ocaml_llvm_vectorize |
135 |
|
135 |
) |
136 |
foreach(llvm_target ${LLVM_TARGETS_TO_BUILD}) |
136 |
|
137 |
list(APPEND doc_targets ocaml_llvm_${llvm_target}) |
137 |
foreach(llvm_target ${LLVM_TARGETS_TO_BUILD}) |
138 |
endforeach() |
138 |
list(APPEND doc_targets ocaml_llvm_${llvm_target}) |
139 |
|
139 |
endforeach() |
140 |
set(odoc_files) |
140 |
|
141 |
foreach( doc_target ${doc_targets} ) |
141 |
set(odoc_files) |
142 |
get_target_property(odoc_file ${doc_target} OCAML_ODOC) |
142 |
foreach( doc_target ${doc_targets} ) |
143 |
list(APPEND odoc_files -load ${odoc_file}) |
143 |
get_target_property(odoc_file ${doc_target} OCAML_ODOC) |
144 |
endforeach() |
144 |
list(APPEND odoc_files -load ${odoc_file}) |
145 |
|
145 |
endforeach() |
146 |
add_custom_target(ocaml_doc |
146 |
|
147 |
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html |
147 |
add_custom_target(ocaml_doc |
148 |
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html |
148 |
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html |
149 |
COMMAND ${OCAMLFIND} ocamldoc -d ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html |
149 |
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html |
150 |
-sort -colorize-code -html ${odoc_files}) |
150 |
COMMAND ${OCAMLFIND} ocamldoc -d ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html |
151 |
|
151 |
-sort -colorize-code -html ${odoc_files}) |
152 |
add_dependencies(ocaml_doc ${doc_targets}) |
152 |
|
153 |
|
153 |
add_dependencies(ocaml_doc ${doc_targets}) |
154 |
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) |
154 |
|
155 |
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html |
155 |
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) |
156 |
DESTINATION docs/ocaml/html) |
156 |
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ocamldoc/html |
|
|
157 |
DESTINATION docs/ocaml/html) |
158 |
endif() |
157 |
endif() |
159 |
endif() |
158 |
endif() |
160 |
endif(LLVM_ENABLE_OCAMLDOC) |