From: <hez...@us...> - 2009-10-12 04:08:10
|
Revision: 10526 http://plplot.svn.sourceforge.net/plplot/?rev=10526&view=rev Author: hezekiahcarty Date: 2009-10-12 04:08:02 +0000 (Mon, 12 Oct 2009) Log Message: ----------- Add (broken) support for building OCaml API reference documentation There do not seem to be any cmake-time or build-time errors, but none of the HTML output is built by target_plplot_doc or target_plcairo_doc. Modified Paths: -------------- trunk/bindings/ocaml/CMakeLists.txt trunk/bindings/ocaml/plcairo/CMakeLists.txt trunk/cmake/modules/ocaml.cmake Modified: trunk/bindings/ocaml/CMakeLists.txt =================================================================== --- trunk/bindings/ocaml/CMakeLists.txt 2009-10-11 23:08:14 UTC (rev 10525) +++ trunk/bindings/ocaml/CMakeLists.txt 2009-10-12 04:08:02 UTC (rev 10526) @@ -222,6 +222,35 @@ ) endif(OCAMLOPT) + if(OCAMLDOC AND BUILD_DOC) + # Build OCaml API reference documentation + set(OCAMLDOC_FILE_LIST + index_attributes.html index_modules.html Plplot.Plot.html + index_classes.html index_module_types.html Plplot.Quick_plot.html + index_class_types.html index_types.html style.css + index_exceptions.html index_values.html type_Plplot.html + index.html Plplot.html type_Plplot.Plot.html + index_methods.html plplot.mli type_Plplot.Quick_plot.html + ) + set(OCAMLDOC_FILES) + foreach(html_file ${OCAMLDOC_FILE_LIST}) + list(APPEND ${OCAMLDOC_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${html_file}) + endforeach(html_file ${OCAMLDOC_FILE_LIST}) + # ocamldoc builds the module's documentation using specially formatted + # comments in the source file. + add_custom_command( + OUTPUT "${OCAMLDOC_FILES}" + COMMAND ${OCAMLDOC} -html ${CMAKE_CURRENT_SOURCE_DIR}/plplot.mli + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/plplot.mli + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + add_custom_target(target_plplot_doc + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/plplot.mli + ) + endif(OCAMLDOC AND BUILD_DOC) + # Basic build done, now trying to finish up by adapting bits # and pieces of old build procedure below. Modified: trunk/bindings/ocaml/plcairo/CMakeLists.txt =================================================================== --- trunk/bindings/ocaml/plcairo/CMakeLists.txt 2009-10-11 23:08:14 UTC (rev 10525) +++ trunk/bindings/ocaml/plcairo/CMakeLists.txt 2009-10-12 04:08:02 UTC (rev 10526) @@ -168,6 +168,34 @@ ) endif(OCAMLOPT) + if(OCAMLFIND AND OCAMLDOC AND BUILD_DOC) + # Build OCaml API reference documentation + set(OCAMLDOC_FILE_LIST + index_attributes.html index_methods.html Plcairo.html + index_classes.html index_modules.html style.css + index_class_types.html index_module_types.html type_Plcairo.html + index_exceptions.html index_types.html + index.html index_values.html + ) + set(OCAMLDOC_FILES) + foreach(html_file ${OCAMLDOC_FILE_LIST}) + list(APPEND ${OCAMLDOC_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${html_file}) + endforeach(html_file ${OCAMLDOC_FILE_LIST}) + # ocamldoc builds the module's documentation using specially formatted + # comments in the source file. Source can be a .ml or a .mli. + add_custom_command( + OUTPUT "${OCAMLDOC_FILES}" + COMMAND ${OCAMLFIND} doc -package cairo -html ${CMAKE_CURRENT_SOURCE_DIR}/plcairo.mli + DEPENDS + ${CMAKE_CURRENT_BINARY_DIR}/plcairo.mli + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + add_custom_target(target_plcairo_doc + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/plcairo.mli + ) + endif(OCAMLFIND AND OCAMLDOC AND BUILD_DOC) + # These targets depend on common files in their respective # file-dependency chains. Therefore, to avoid screwing up parallel # builds must serialize with target depends. Modified: trunk/cmake/modules/ocaml.cmake =================================================================== --- trunk/cmake/modules/ocaml.cmake 2009-10-11 23:08:14 UTC (rev 10525) +++ trunk/cmake/modules/ocaml.cmake 2009-10-12 04:08:02 UTC (rev 10526) @@ -86,6 +86,16 @@ endif (OCAMLFIND) endif(ENABLE_ocaml) +if(ENABLE_ocaml AND BUILD_DOC) + find_program(OCAMLDOC NAMES ocamldoc.opt ocamldoc) + if (OCAMLDOC) + message(STATUS "OCAMLDOC = ${OCAMLDOC}") + else (OCAMLDOC) + message(STATUS "WARNING:" + "ocamldoc not found. Disabling OCaml API documentation generation") + endif (OCAMLDOC) +endif(ENABLE_ocaml AND BUILD_DOC) + if(ENABLE_ocaml) execute_process(COMMAND ${OCAMLC} -version OUTPUT_VARIABLE OCAML_VERSION This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |