4 OPTION(DBUS_ENABLE_DOXYGEN_DOCS "build DOXYGEN documentation (requires Doxygen)" ON)
5 endif(DOXYGEN_EXECUTABLE)
7 if (DBUS_ENABLE_DOXYGEN_DOCS)
8 set (top_srcdir ${CMAKE_SOURCE_DIR}/..)
9 configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_BINARY_DIR}/Doxyfile )
11 COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
13 endif (DBUS_ENABLE_DOXYGEN_DOCS)
16 # find docbook generator
18 find_program(MEINPROC_EXECUTABLE meinproc4)
20 find_program(XMLTO_EXECUTABLE xmlto)
22 if (MEINPROC_EXECUTABLE OR XMLTO_EXECUTABLE)
23 OPTION(DBUS_ENABLE_XML_DOCS "build XML documentation (requires xmlto or meinproc4)" ON)
24 endif (MEINPROC_EXECUTABLE OR XMLTO_EXECUTABLE)
26 if (MEINPROC_EXECUTABLE)
27 set(DOCBOOK_GENERATOR_NAME "meinproc4" PARENT_SCOPE)
28 set(DBUS_XML_DOCS_ENABLED 1)
29 set(STYLESHEET "${CMAKE_INSTALL_PREFIX}/share/apps/ksgmltools2/docbook/xsl/html/docbook.xsl")
30 endif (MEINPROC_EXECUTABLE)
34 set (DOCBOOK_GENERATOR_NAME "xmlto" PARENT_SCOPE)
35 set(DBUS_XML_DOCS_ENABLED 0)
36 MESSAGE(STATUS "xmlto docbook generator found, but xmlto doc generating needs validation")
37 endif (XMLTO_EXECUTABLE)
39 if (DBUS_ENABLE_XML_DOCS)
41 macro (DOCBOOK _sources _options)
42 get_filename_component(_infile ${_sources} REALPATH)
43 get_filename_component(_basename ${_infile} NAME_WE)
44 set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.html)
46 if (EXISTS ${_sources})
47 if (MEINPROC_EXECUTABLE)
48 ADD_CUSTOM_TARGET(${_basename}.html ALL
49 meinproc4 --stylesheet ${STYLESHEET} -o ${_outfile} ${_infile}
51 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
55 ADD_CUSTOM_TARGET(${_basename}.html ALL
56 xmlto.bat ${_options} ${_infile}
58 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
61 install(FILES ${_outfile} DESTINATION share/doc/dbus)
63 MESSAGE(STATUS "skipping xml doc generating for ${_infile}, file not found")
68 ### copy tests to builddir so that generated tests and static tests
69 ### are all in one place.
70 ### todo how to add more filetypes
71 MACRO (COPYDIR _src _type)
72 FOREACH(FILE_TYPE ${_type})
74 FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${DIR}/${FILE_TYPE}" )
75 FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
76 FOREACH(FILE ${FILES})
77 GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
78 SET (TARGET ${CMAKE_BINARY_DIR}/${DIR}/${FILENAME})
79 configure_file(${FILE} ${TARGET} COPYONLY)
81 MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
82 ENDIF (CONFIG_VERBOSE)
91 DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-test-plan.xml html-nochunks)
92 DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-tutorial.xml html-nochunks)
93 DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-specification.xml html-nochunks)
94 DOCBOOK(${CMAKE_SOURCE_DIR}/../doc/dbus-faq.xml html-nochunks)
95 DOCBOOK(${CMAKE_SOURCE_DIR}/bus/dbus-daemon.xml html-nochunks)
96 DOCBOOK(${CMAKE_SOURCE_DIR}/tools/dbus-monitor.xml html-nochunks)
97 DOCBOOK(${CMAKE_SOURCE_DIR}/tools/dbus-send.xml html-nochunks)
98 DOCBOOK(${CMAKE_SOURCE_DIR}/tools/dbus-launch.xml html-nochunks)
101 # handle html index file
103 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/index.html.cmake ${CMAKE_CURRENT_BINARY_DIR}/index.html )
104 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/index.html DESTINATION share/doc/dbus)
107 ${CMAKE_SOURCE_DIR}/../doc/busconfig.dtd
108 ${CMAKE_SOURCE_DIR}/../doc/introspect.dtd
109 ${CMAKE_SOURCE_DIR}/../doc/introspect.xsl
112 install(FILES ${EXTRA_DIST} DESTINATION share/doc/dbus)
114 endif(DBUS_ENABLE_XML_DOCS)