"Fossies" - the Fresh Open Source Software Archive

Member "dbus-1.13.18/doc/CMakeLists.txt" (1 Jul 2020, 9383 Bytes) of package /linux/misc/dbus-1.13.18.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 1.13.16_vs_1.13.18.

    1 #
    2 # api documentation
    3 #
    4 find_package(Doxygen)
    5 
    6 # always check doc target
    7 add_custom_target(doc ALL)
    8 
    9 if(DOXYGEN_EXECUTABLE)
   10     option(DBUS_ENABLE_DOXYGEN_DOCS "build DOXYGEN documentation (requires Doxygen)" ON)
   11     add_auto_option(ENABLE_QT_HELP "build qt help documentation (requires qhelpgenerator(-qt5)); set INSTALL_QCH_DIR for custom qch installation path" AUTO)
   12 endif()
   13 
   14 if(DBUS_ENABLE_DOXYGEN_DOCS)
   15     set(top_srcdir ${CMAKE_SOURCE_DIR})
   16     set(top_builddir ${CMAKE_BINARY_DIR})
   17     if(WIN32)
   18         set(DBUS_GENERATE_MAN NO)
   19     else()
   20         set(DBUS_GENERATE_MAN YES)
   21     endif()
   22     if(NOT DEFINED INSTALL_QCH_DIR)
   23         set(INSTALL_QCH_DIR ${CMAKE_INSTALL_DATADIR}/doc/dbus)
   24     endif()
   25     find_program(QHELPGENERATOR_EXECUTABLE NAMES qhelpgenerator qhelpgenerator-qt5)
   26     check_auto_option(ENABLE_QT_HELP "Qt help" QHELPGENERATOR_EXECUTABLE "qhelpgenerator")
   27     if(ENABLE_QT_HELP AND QHELPGENERATOR_EXECUTABLE)
   28         message(STATUS "${QHELPGENERATOR_EXECUTABLE} found")
   29         set(DOXYGEN_GENERATE_QHP YES)
   30         set(DOXYGEN_QHG_LOCATION ${QHELPGENERATOR_EXECUTABLE})
   31         set(DOXYGEN_QCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/api/qch/dbus-${VERSION}.qch)
   32         set(DBUS_ENABLE_QTHELP_DOCS ON PARENT_SCOPE)
   33         install(FILES ${DOXYGEN_QCH_FILE} DESTINATION ${INSTALL_QCH_DIR})
   34     else()
   35         set(DOXYGEN_GENERATE_QHP NO)
   36         set(DBUS_ENABLE_QTHELP_DOCS OFF PARENT_SCOPE)
   37     endif()
   38     configure_file(../Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile )
   39     file(GLOB dbus_files "${CMAKE_SOURCE_DIR}/dbus/*.[ch]*")
   40     add_custom_command(
   41         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/doxygen.stamp
   42         DEPENDS ${CMAKE_SOURCE_DIR}/Doxyfile.in  ${CMAKE_BINARY_DIR}/Doxyfile ${dbus_files}
   43         COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/api/html
   44         COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/api/man
   45         COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/api/xml
   46         COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
   47         COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/doxygen.stamp
   48         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   49         COMMENT "Generating API documentation with Doxygen"
   50     )
   51     add_custom_target(apidoc
   52         DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doxygen.stamp
   53     )
   54     add_dependencies(doc apidoc)
   55     install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/api/html/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/dbus/api)
   56 endif()
   57 
   58 find_program(XSLTPROC_EXECUTABLE xsltproc)
   59 if(XSLTPROC_EXECUTABLE)
   60     message(STATUS "${XSLTPROC_EXECUTABLE} found")
   61     set(DBUS_HAVE_XSLTPROC 1)
   62 endif()
   63 
   64 if(DBUS_HAVE_XSLTPROC AND DBUS_ENABLE_DOXYGEN_DOCS)
   65     add_custom_command(
   66         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dbus.devhelp2
   67         COMMAND ${XSLTPROC_EXECUTABLE}
   68             -o ${CMAKE_CURRENT_BINARY_DIR}/dbus.devhelp2
   69             ${CMAKE_CURRENT_SOURCE_DIR}/doxygen_to_devhelp.xsl
   70             ${CMAKE_CURRENT_BINARY_DIR}/api/xml/index.xml
   71         DEPENDS
   72             ${CMAKE_CURRENT_SOURCE_DIR}/doxygen_to_devhelp.xsl
   73             ${CMAKE_CURRENT_BINARY_DIR}/doxygen.stamp
   74     )
   75     add_custom_target(devhelp2
   76         DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dbus.devhelp2
   77     )
   78     add_dependencies(doc devhelp2)
   79     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dbus.devhelp2 DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/dbus)
   80 endif()
   81 
   82 #
   83 # docbook based documentation
   84 # 
   85 find_package(DocBookXSL)
   86 
   87 if(DOCBOOKXSL_DIR AND XSLTPROC_EXECUTABLE)
   88     option(DBUS_ENABLE_XML_DOCS "build XML documentation" ON)
   89     set(DBUS_XML_DOCS_ENABLED 1)
   90     message(STATUS "xsltproc docbook generator found")
   91     add_custom_target(xmldoc)
   92     add_dependencies(doc xmldoc)
   93 endif()
   94 
   95 if(DBUS_ENABLE_XML_DOCS)
   96 #
   97 # generate docbook file from template
   98 #
   99 macro(generate_docbook_file a b)
  100     get_filename_component(outname ${b} NAME)
  101     set(srcfile ${CMAKE_CURRENT_SOURCE_DIR}/${a})
  102     set(tmpfile ${CMAKE_CURRENT_BINARY_DIR}/${outname}.tmp.cmake)
  103     file(WRITE ${tmpfile} "
  104 set(EXPANDED_SYSCONFDIR ${CMAKE_INSTALL_FULL_SYSCONFDIR})
  105 set(EXPANDED_DATADIR ${CMAKE_INSTALL_FULL_DATADIR})
  106 set(DBUS_VERSION ${DBUS_VERSION})
  107 configure_file(${srcfile} ${b})
  108     ")
  109     add_custom_command(OUTPUT ${b}
  110         COMMAND ${CMAKE_COMMAND} -E remove ${b}
  111         COMMAND ${CMAKE_COMMAND} -P ${tmpfile}
  112         DEPENDS ${srcfile} ${CMAKE_BINARY_DIR}/CMakeCache.txt
  113         COMMENT "Generating ${outname}"
  114     )
  115     add_custom_target(${outname} DEPENDS ${b})
  116     add_dependencies(doc ${outname})
  117 endmacro()
  118 
  119 macro(DOCBOOK _sources _format)
  120     get_filename_component(_infile ${_sources} ABSOLUTE)
  121     get_filename_component(_name ${_infile} NAME)
  122     if(${_format} STREQUAL "man")
  123         string(REPLACE ".xml" "" _outname ${_name})
  124         set(STYLESHEET "${DOCBOOKXSL_DIR}/manpages/docbook.xsl")
  125     else()
  126         string(REPLACE ".xml" ".html" _outname ${_name})
  127         set(STYLESHEET "${DOCBOOKXSL_DIR}/html/docbook.xsl")
  128     endif()
  129     set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_outname})
  130     add_custom_command(
  131         OUTPUT ${_outfile}
  132         COMMAND ${XSLTPROC_EXECUTABLE} --output ${_outfile} --nonet --xinclude  --param passivetex.extensions '1' ${STYLESHEET} ${_infile}
  133         DEPENDS ${XSLTPROC_EXECUTABLE} ${_infile}
  134         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  135     )
  136     add_custom_target(${_outname} DEPENDS ${_outfile})
  137     add_dependencies(xmldoc ${_outname})
  138     if(${_format} STREQUAL "man")
  139         install(FILES ${_outfile} DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1)
  140     else()
  141         install(FILES ${_outfile} DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/dbus)
  142     endif()
  143 endmacro()
  144 
  145 ### copy tests to builddir so that generated tests and static tests 
  146 ### are all in one place.
  147 ### todo how to add more filetypes 
  148 macro(COPYDIR _src _type)
  149     foreach(FILE_TYPE ${_type})
  150         foreach(DIR ${_src})
  151             file(GLOB FILES "${DIR}/${FILE_TYPE}" )
  152             file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
  153             foreach(FILE ${FILES})
  154                 get_filename_component(FILENAME ${FILE} NAME)
  155                 set(TARGET ${CMAKE_BINARY_DIR}/${DIR}/${FILENAME})
  156                 configure_file(${FILE} ${TARGET} COPYONLY)
  157                 if(CONFIG_VERBOSE)
  158                     message("FROM: ${FILE}\nTO: ${TARGET}\n")
  159                 endif()
  160             endforeach()
  161         endforeach()
  162     endforeach()
  163 endmacro()
  164 
  165 COPYDIR(doc *.png)
  166 COPYDIR(doc *.svg)
  167 
  168 generate_docbook_file(dbus-cleanup-sockets.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-cleanup-sockets.1.xml)
  169 generate_docbook_file(dbus-daemon.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-daemon.1.xml)
  170 generate_docbook_file(dbus-launch.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-launch.1.xml)
  171 generate_docbook_file(dbus-monitor.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-monitor.1.xml)
  172 generate_docbook_file(dbus-run-session.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-run-session.1.xml)
  173 generate_docbook_file(dbus-send.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-send.1.xml)
  174 generate_docbook_file(dbus-test-tool.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-test-tool.1.xml)
  175 generate_docbook_file(dbus-update-activation-environment.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-update-activation-environment.1.xml)
  176 generate_docbook_file(dbus-uuidgen.1.xml.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-uuidgen.1.xml)
  177 
  178 docbook(${CMAKE_CURRENT_SOURCE_DIR}/dbus-test-plan.xml html)
  179 docbook(${CMAKE_CURRENT_SOURCE_DIR}/dbus-tutorial.xml html)
  180 docbook(${CMAKE_CURRENT_SOURCE_DIR}/dbus-specification.xml html)
  181 docbook(${CMAKE_CURRENT_SOURCE_DIR}/dbus-faq.xml html)
  182 
  183 if(UNIX)
  184     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-daemon.1.xml man)
  185     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-monitor.1.xml man)
  186     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-run-session.1.xml man)
  187     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-send.1.xml man)
  188     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-test-tool.1.xml man)
  189     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-launch.1.xml man)
  190     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-uuidgen.1.xml man)
  191     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-cleanup-sockets.1.xml man)
  192     docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-update-activation-environment.1.xml man)
  193 endif()
  194 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-daemon.1.xml html)
  195 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-monitor.1.xml html)
  196 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-run-session.1.xml html)
  197 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-send.1.xml html)
  198 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-test-tool.1.xml html)
  199 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-launch.1.xml html)
  200 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-uuidgen.1.xml html)
  201 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-cleanup-sockets.1.xml html)
  202 docbook(${CMAKE_CURRENT_BINARY_DIR}/dbus-update-activation-environment.1.xml html)
  203 
  204 #
  205 # handle html index file
  206 #
  207 configure_file(index.html.in ${CMAKE_CURRENT_BINARY_DIR}/index.html)
  208 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/index.html DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/dbus)
  209 
  210 #
  211 # misc files
  212 #
  213 set(DTD_DATA
  214     diagram.png
  215     diagram.svg
  216 )
  217 
  218 install(FILES ${DTD_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/dbus)
  219 
  220 set(DOC_DATA
  221     system-activation.txt
  222 )
  223 
  224 install(FILES ${DOC_DATA} DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/dbus)
  225 
  226 set(EXTRA_DIST
  227     busconfig.dtd
  228     introspect.dtd
  229     introspect.xsl
  230 )
  231 
  232 install(FILES ${EXTRA_DIST} DESTINATION ${CMAKE_INSTALL_DATADIR}/xml/dbus-1)
  233 
  234 endif()