diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2010-02-10 09:26:52 +0100 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2010-02-10 09:26:52 +0100 |
commit | a931e6176396b47d7149785ae9daf9c1cb2176de (patch) | |
tree | df06f57e0ea3cd48e5f7cc106e9bfa01c90f377e /cmake | |
parent | 523e01827eac49ec30afa173d31cdeee4be6381a (diff) |
fixed xml doc generating for cmake build system - supported docbook generator is currently kde's meinproc4, xmlto may also work but need still some checks
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CMakeLists.txt | 4 | ||||
-rw-r--r-- | cmake/doc/CMakeLists.txt | 99 |
2 files changed, 67 insertions, 36 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index a9c6af5e..1333d9d9 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -531,7 +531,7 @@ message(" 64-bit int: ${DBUS_INT64_TYPE} " message(" 32-bit int: ${DBUS_INT32_TYPE} ") message(" 16-bit int: ${DBUS_INT16_TYPE} ") message(" Doxygen: ${DOXYGEN} ") -message(" xmlto: ${XMLTO} ") +message(" Docbook Generator: ${DOCBOOK_GENERATOR_NAME} ") #message(" Maintainer mode: ${USE_MAINTAINER_MODE} ") @@ -544,7 +544,7 @@ message(" installing system libs: ${DBUS_INSTALL_SYSTEM_LIBS} " #message(" Building SELinux support: ${have_selinux} ") #message(" Building dnotify support: ${have_dnotify} ") message(" Building Doxygen docs: ${DBUS_ENABLE_DOXYGEN_DOCS} ") -#message(" Building XML docs: ${enable_xml_docs} ") +message(" Building XML docs: ${DBUS_ENABLE_XML_DOCS} ") #message(" Gettext libs (empty OK): ${INTLLIBS} ") message(" Using XML parser: ${XML_LIB} ") message(" Daemon executable name: ${DBUS_DAEMON_NAME}") diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt index dd46708b..10be59e5 100644 --- a/cmake/doc/CMakeLists.txt +++ b/cmake/doc/CMakeLists.txt @@ -12,45 +12,57 @@ if (DBUS_ENABLE_DOXYGEN_DOCS) ) endif (DBUS_ENABLE_DOXYGEN_DOCS) -#AC_ARG_ENABLE(xml-docs, AS_HELP_STRING([--enable-xml-docs],[build XML documentation (requires xmlto)]),enable_xml_docs=$enableval,enable_xml_docs=auto) -#xmldocs missing +# +# find docbook generator +# +find_program(MEINPROC_EXECUTABLE meinproc4) -# depends on xmlto -set(DBUS_XML_DOCS_ENABLED 0) +find_program(XMLTO_EXECUTABLE xmlto) -set (EXTRA_DIST - busconfig.dtd - introspect.dtd - dbus-faq.xml - dbus-specification.xml - dbus-test-plan.xml - dbus-tutorial.xml - dcop-howto.txt - file-boilerplate.c - introspect.xsl -) +if (MEINPROC_EXECUTABLE OR XMLTO_EXECUTABLE) + OPTION(DBUS_ENABLE_XML_DOCS "build XML documentation (requires xmlto or meinproc4)" ON) +endif (MEINPROC_EXECUTABLE OR XMLTO_EXECUTABLE) -set (HTML_FILES - dbus-faq.html - dbus-specification.html - dbus-test-plan.html - dbus-tutorial.html -) +if (MEINPROC_EXECUTABLE) + set(DOCBOOK_GENERATOR_NAME "meinproc4" PARENT_SCOPE) + set(DBUS_XML_DOCS_ENABLED 1) + set(STYLESHEET "${CMAKE_INSTALL_PREFIX}/share/apps/ksgmltools2/docbook/xsl/html/docbook.xsl") +endif (MEINPROC_EXECUTABLE) + + +if (XMLTO_EXECUTABLE) + set (DOCBOOK_GENERATOR_NAME "xmlto" PARENT_SCOPE) + set(DBUS_XML_DOCS_ENABLED 0) + MESSAGE(STATUS "xmlto docbook generator found, but xmlto doc generating needs validation") +endif (XMLTO_EXECUTABLE) -if (DBUS_XML_DOCS_ENABLED) +if (DBUS_ENABLE_XML_DOCS) macro (DOCBOOK _sources _options) - get_filename_component(_tmp_FILE ${_sources} ABSOLUTE) - get_filename_component(_basename ${_tmp_FILE} NAME_WE) - set(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.html) - MESSAGE (${_header} ${_sources} ${_options} ${_basename}) - - ADD_CUSTOM_TARGET(${_basename}.html ALL - xmlto.bat ${_sources} -# xmlto.bat ${_options} ${_sources} - DEPENDS ${_sources} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) + get_filename_component(_infile ${_sources} REALPATH) + get_filename_component(_basename ${_infile} NAME_WE) + set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.html) + + if (EXISTS ${_sources}) + if (MEINPROC_EXECUTABLE) + ADD_CUSTOM_TARGET(${_basename}.html ALL + meinproc4 --stylesheet ${STYLESHEET} -o ${_outfile} ${_infile} + DEPENDS ${_infile} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + endif () + if (XMLTO_EXECUTABLE) + ADD_CUSTOM_TARGET(${_basename}.html ALL + xmlto.bat ${_options} ${_infile} + DEPENDS ${_infile} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + endif () + install(FILES ${_outfile} DESTINATION share/doc/dbus) + else () + MESSAGE(STATUS "skipping xml doc generating for ${_infile}, file not found") + endif () + endmacro (DOCBOOK) ### copy tests to builddir so that generated tests and static tests @@ -80,5 +92,24 @@ DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-test-plan.xml html-nochunks) DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-tutorial.xml html-nochunks) DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-specification.xml html-nochunks) DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-faq.xml html-nochunks) +# optional: we do not like to have troff installed on windows too and therefore need files converted from troff to docbook by doclifter +DOCBOOK(${CMAKE_SOURCE_DIR}/../bus/dbus-daemon.xml html-nochunks) +DOCBOOK(${CMAKE_SOURCE_DIR}/../tools/dbus-monitor.xml html-nochunks) +DOCBOOK(${CMAKE_SOURCE_DIR}/../tools/dbus-send.xml html-nochunks) +DOCBOOK(${CMAKE_SOURCE_DIR}/../tools/dbus-launch.xml html-nochunks) + +# +# handle html index file +# +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index.html.cmake ${CMAKE_CURRENT_BINARY_DIR}/index.html ) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/index.html DESTINATION share/doc/dbus) + +set (EXTRA_DIST + ${CMAKE_SOURCE_DIR}/../doc/busconfig.dtd + ${CMAKE_SOURCE_DIR}/../doc/introspect.dtd + ${CMAKE_SOURCE_DIR}/../doc/introspect.xsl +) + +install(FILES ${EXTRA_DIST} DESTINATION share/doc/dbus) -endif(DBUS_XML_DOCS_ENABLED) +endif(DBUS_ENABLE_XML_DOCS) |