From bac2fd3aa458c7dfd002f7ec96a245d630c5830f Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 19 Nov 2018 20:29:33 +0100 Subject: [PATCH 1/5] ci-build.sh: Show file size in list of files to be able to compare generated file size --- tools/ci-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci-build.sh b/tools/ci-build.sh index 3f4bc595..36f918d2 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -288,7 +288,7 @@ case "$ci_buildsys" in export DBUS_TEST_MALLOC_FAILURES=0 [ "$ci_test" = no ] || ctest -VV || maybe_fail_tests ${make} install DESTDIR=$(pwd)/DESTDIR - ( cd DESTDIR && find . ) + ( cd DESTDIR && find . -ls) ;; esac From 1acdf596192131613a83801152796fc1be592a22 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 20 Nov 2018 13:56:39 +0100 Subject: [PATCH 2/5] Cleanup of cmake doc-related targets There is now a top-level target "doc" that is always built. Depending on the detected generators it depends on optional targets like apidoc' and 'devhelp2'. --- cmake/doc/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt index 11634e1b..403aee78 100644 --- a/cmake/doc/CMakeLists.txt +++ b/cmake/doc/CMakeLists.txt @@ -2,6 +2,9 @@ SET(DOC_DIR ${CMAKE_SOURCE_DIR}/../doc) find_package(Doxygen) +# build doc always +add_custom_target(doc ALL) + if(DOXYGEN_EXECUTABLE) OPTION(DBUS_ENABLE_DOXYGEN_DOCS "build DOXYGEN documentation (requires Doxygen)" ON) endif(DOXYGEN_EXECUTABLE) @@ -14,9 +17,15 @@ if (DBUS_ENABLE_DOXYGEN_DOCS) COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) - add_custom_target(doc + add_custom_target(apidoc + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + add_dependencies(doc apidoc) + add_custom_target(devhelp2 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/api/html/index.html ${CMAKE_CURRENT_BINARY_DIR}/dbus.devhelp2 ) + add_dependencies(doc devhelp2) endif (DBUS_ENABLE_DOXYGEN_DOCS) find_program(XSLTPROC_EXECUTABLE xsltproc) From 0764f08e7eabfc03806c25f8e987a3eb4eec6e54 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 20 Nov 2018 14:06:17 +0100 Subject: [PATCH 3/5] Fix broken meinproc4 based docbook generating by already used xsltproc Using xsltproc helps to reduce manual editing of xml doc and avoids cyclic dependency (kdelibs depends on dbus and dbus depends on kdelibs). It is available on all platforms (in the opposite to xmlto) and supports freedesktop CI out of the box. This commit adds docbook-xml and docbook-xsl as new dependency for cmake and removes obsolate xmlto support, which depends on xsltproc. --- cmake/doc/CMakeLists.txt | 198 ++++++++++++++++----------------------- tools/ci-install.sh | 2 + 2 files changed, 81 insertions(+), 119 deletions(-) diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt index 403aee78..d30e9e39 100644 --- a/cmake/doc/CMakeLists.txt +++ b/cmake/doc/CMakeLists.txt @@ -1,5 +1,8 @@ SET(DOC_DIR ${CMAKE_SOURCE_DIR}/../doc) +# +# api documentation +# find_package(Doxygen) # build doc always @@ -44,96 +47,51 @@ if(DBUS_HAVE_XSLTPROC) endif() # -# find docbook generator +# docbook based documentation # -find_program(MEINPROC4_EXECUTABLE meinproc4) +find_package(DocBookXSL) -find_program(XMLTO_EXECUTABLE xmlto) +if(DOCBOOKXSL_DIR AND XSLTPROC_EXECUTABLE) + option(DBUS_ENABLE_XML_DOCS "build XML documentation" ON) + set(DBUS_XML_DOCS_ENABLED 1) + message(STATUS "xsltproc docbook generator found") + add_custom_target(xmldoc) + add_dependencies(doc xmldoc) +endif() -find_program(CYGPATH_EXECUTABLE cygpath) +if(DBUS_ENABLE_XML_DOCS) -if (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE) - OPTION(DBUS_ENABLE_XML_DOCS "build XML documentation (requires xmlto or meinproc4)" ON) - ADD_CUSTOM_TARGET(xmldoc ALL) -endif (MEINPROC4_EXECUTABLE OR XMLTO_EXECUTABLE) +macro(DOCBOOK _sources _format) + get_filename_component(_infile ${_sources} ABSOLUTE) + get_filename_component(_name ${_infile} NAME) + if(${_format} STREQUAL "man") + string(REPLACE ".xml" "" _outname ${_name}) + set(STYLESHEET "${DOCBOOKXSL_DIR}/manpages/docbook.xsl") + else() + string(REPLACE ".xml" ".html" _outname ${_name}) + set(STYLESHEET "${DOCBOOKXSL_DIR}/html/docbook.xsl") + endif() + set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_outname}) -if (XMLTO_EXECUTABLE) - set (DOCBOOK_GENERATOR_NAME "xmlto" PARENT_SCOPE) - set(DBUS_XML_DOCS_ENABLED 1) - set(MEINPROC4_EXECUTABLE 0) - MESSAGE(STATUS "xmlto docbook generator found") - set(STYLESHEET_MAN "${DOCBOOKXSL_DIR}/manpages/docbook.xsl") - set(STYLESHEET_HTML "${DOCBOOKXSL_DIR}/html/docbook.xsl") - -elseif (MEINPROC4_EXECUTABLE) - set(DOCBOOK_GENERATOR_NAME "meinproc4" PARENT_SCOPE) - set(DBUS_XML_DOCS_ENABLED 1) - if(WIN32) - get_filename_component(_a ${MEINPROC4_EXECUTABLE} PATH) - get_filename_component(_meinproc_install_path ${_a} PATH) - set(STYLESHEET_HTML "${_meinproc_install_path}/share/apps/ksgmltools2/docbook/xsl/html/docbook.xsl") - else(WIN32) - set(STYLESHEET_HTML file:///usr/share/kde4/apps/ksgmltools2/customization/kde-nochunk.xsl) - endif(WIN32) -endif () - -if (DBUS_ENABLE_XML_DOCS) - -macro (DOCBOOK _sources _format) - get_filename_component(_infile ${_sources} ABSOLUTE) - get_filename_component(_name ${_infile} NAME) - set(_deps ${CMAKE_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt) - - if (${_format} STREQUAL "man") - string(REPLACE ".xml" "" _outname ${_name}) - set(STYLESHEET ${STYLESHEET_MAN}) - else() - string(REPLACE ".xml" ".html" _outname ${_name}) - set(STYLESHEET ${STYLESHEET_HTML}) - endif () - - set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_outname}) - if (EXISTS ${_sources}) - if (MEINPROC4_EXECUTABLE) - ADD_CUSTOM_COMMAND( - OUTPUT ${_outfile} - COMMAND ${MEINPROC4_EXECUTABLE} --stylesheet ${STYLESHEET} -o ${_outfile} ${_infile} - DEPENDS ${_infile} ${STYLESHEET} ${_deps} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - endif () - if (XMLTO_EXECUTABLE) - if (MSYS) - if (CYGPATH_EXECUTABLE) - execute_process( - COMMAND cygpath ${_infile} - OUTPUT_VARIABLE _infile) - else () - execute_process(COMMAND dirname ${_infile} OUTPUT_VARIABLE _path) - string(STRIP ${_path} _path) - execute_process(COMMAND sh -c "cd ${_path}; pwd -W" OUTPUT_VARIABLE _path) - string(STRIP ${_path} _path) - set(_infile "${_path}/${_name}") - endif(CYGPATH_EXECUTABLE) - endif (MSYS) - ADD_CUSTOM_COMMAND( - OUTPUT ${_outfile} - COMMAND ${XMLTO_EXECUTABLE} -vv ${_format} ${_infile} - DEPENDS ${_infile} ${_deps} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) - endif () - if (${_format} STREQUAL "man") - install(FILES ${_outfile} DESTINATION share/man/man1) - else () - install(FILES ${_outfile} DESTINATION share/doc/dbus) - endif () - else () - MESSAGE(STATUS "skipping xml doc generating for ${_infile}, file not found") - endif () - ADD_CUSTOM_TARGET(${_outname} DEPENDS ${_outfile}) - ADD_DEPENDENCIES(xmldoc ${_outname}) -endmacro (DOCBOOK) + set(_outfile ${CMAKE_CURRENT_BINARY_DIR}/${_outname}) + if(EXISTS ${_sources}) + if(XSLTPROC_EXECUTABLE) + add_custom_target(${_outname} + ${XSLTPROC_EXECUTABLE} --output ${_outfile} --nonet --xinclude --param passivetex.extensions '1' ${STYLESHEET} ${_infile} + DEPENDS ${_infile} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + endif () + add_dependencies(xmldoc ${_outname}) + if (${_format} STREQUAL "man") + install(FILES ${_outfile} DESTINATION share/man/man1) + else() + install(FILES ${_outfile} DESTINATION share/doc/dbus) + endif() + 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 ### are all in one place. @@ -158,48 +116,50 @@ ENDMACRO (COPYDIR) COPYDIR(doc *.png) COPYDIR(doc *.svg) -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) -configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-cleanup-sockets.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml) -configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-daemon.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml) -configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-launch.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml) -configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-monitor.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml) -configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-send.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml) -configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-test-tool.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-test-tool.1.xml) -configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-update-activation-environment.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-update-activation-environment.1.xml) -configure_file(${CMAKE_SOURCE_DIR}/../doc/dbus-uuidgen.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml) -DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml html-nochunks) -DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml html-nochunks) -DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml html-nochunks) -DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml html-nochunks) -DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml html-nochunks) -DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-test-tool.1.xml html-nochunks) -DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml html-nochunks) -DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-update-activation-environment.1.xml html-nochunks) -if (UNIX) - DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml man) - DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml man) - DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml man) - DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-test-tool.1.xml man) - DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml man) - DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml man) - DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml man) - DOCBOOK(${CMAKE_BINARY_DIR}/doc/dbus-update-activation-environment.1.xml man) +docbook(${DOC_DIR}/dbus-test-plan.xml html) +docbook(${DOC_DIR}/dbus-tutorial.xml html) +docbook(${DOC_DIR}/dbus-specification.xml html) +docbook(${DOC_DIR}/dbus-faq.xml html) + +configure_file(${DOC_DIR}/dbus-cleanup-sockets.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml) +configure_file(${DOC_DIR}/dbus-daemon.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml) +configure_file(${DOC_DIR}/dbus-launch.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml) +configure_file(${DOC_DIR}/dbus-monitor.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml) +configure_file(${DOC_DIR}/dbus-send.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml) +configure_file(${DOC_DIR}/dbus-test-tool.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-test-tool.1.xml) +configure_file(${DOC_DIR}/dbus-update-activation-environment.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-update-activation-environment.1.xml) +configure_file(${DOC_DIR}/dbus-uuidgen.1.xml.in ${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml) +if(UNIX) + docbook(${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml man) + docbook(${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml man) + docbook(${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml man) + docbook(${CMAKE_BINARY_DIR}/doc/dbus-test-tool.1.xml man) + docbook(${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml man) + docbook(${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml man) + docbook(${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml man) + docbook(${CMAKE_BINARY_DIR}/doc/dbus-update-activation-environment.1.xml man) endif() +docbook(${CMAKE_BINARY_DIR}/doc/dbus-daemon.1.xml html) +docbook(${CMAKE_BINARY_DIR}/doc/dbus-monitor.1.xml html) +docbook(${CMAKE_BINARY_DIR}/doc/dbus-send.1.xml html) +docbook(${CMAKE_BINARY_DIR}/doc/dbus-test-tool.1.xml html) +docbook(${CMAKE_BINARY_DIR}/doc/dbus-launch.1.xml html) +docbook(${CMAKE_BINARY_DIR}/doc/dbus-uuidgen.1.xml html) +docbook(${CMAKE_BINARY_DIR}/doc/dbus-cleanup-sockets.1.xml html) +docbook(${CMAKE_BINARY_DIR}/doc/dbus-update-activation-environment.1.xml html) + # # 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 +set (EXTRA_DIST + ${DOC_DIR}/busconfig.dtd + ${DOC_DIR}/introspect.dtd + ${DOC_DIR}/introspect.xsl ) install(FILES ${EXTRA_DIST} DESTINATION share/doc/dbus) -endif(DBUS_ENABLE_XML_DOCS) +endif() diff --git a/tools/ci-install.sh b/tools/ci-install.sh index 30d4abe0..b50e534e 100755 --- a/tools/ci-install.sh +++ b/tools/ci-install.sh @@ -131,6 +131,8 @@ case "$ci_distro" in debhelper \ dh-autoreconf \ dh-exec \ + docbook-xml \ + docbook-xsl \ doxygen \ dpkg-dev \ gnome-desktop-testing \ From 06219344a85d57f448fb6c86c24f2e50aa6a3ee7 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 20 Nov 2018 15:09:36 +0100 Subject: [PATCH 4/5] Fix incorrect links in index html page used by cmake --- cmake/doc/index.html.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/doc/index.html.cmake b/cmake/doc/index.html.cmake index 77dd6614..ffb1f0fb 100644 --- a/cmake/doc/index.html.cmake +++ b/cmake/doc/index.html.cmake @@ -38,16 +38,16 @@ application manuals
-D-Bus Daemon manual +D-Bus Daemon manual

-D-Bus launch manual +D-Bus launch manual

-D-Bus send tool manual +D-Bus send tool manual

-D-Bus monitor manual +D-Bus monitor manual From a2aecf7d79ff98805dfcc3b8848a872acfea44d5 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 20 Nov 2018 14:19:59 +0100 Subject: [PATCH 5/5] Add xsltproc usage to README.cmake --- README.cmake | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/README.cmake b/README.cmake index 2fe33dcd..40e543a6 100644 --- a/README.cmake +++ b/README.cmake @@ -6,13 +6,16 @@ Requirements - installed libexpat see http://sourceforge.net/projects/expat/ unsupported RelWithDebInfo builds could be fetched from http://sourceforge.net/projects/kde-windows/files/expat/ +- for generating documentation based on docbook files + - xsltproc (provided by the distribution or from http://xmlsoft.org/XSLT/xsltproc2.html) and + - docbook dtd and stylesheets (provided by the distribution or from https://sourceforge.net/projects/docbook/) Building -------- Win32 MinGW-w64|32 1. install mingw-w64 from http://sourceforge.net/projects/mingw-w64/ -2. install cmake and libexpat +2. install cmake, libexpat and optional xsltproc and docbook dtd and stylesheets 3. get dbus sources 4. unpack dbus sources into a sub directory (referred as later) 5. mkdir dbus-build @@ -24,7 +27,7 @@ Win32 MinGW-w64|32 Win32 Microsoft nmake 1. install MSVC 2010 Express Version from http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express -2. install cmake and libexpat +2. install cmake, libexpat and optional xsltproc and docbook dtd and stylesheets 3. get dbus sources 4. unpack dbus sources into a sub directory (referred as later) 5. mkdir dbus-build @@ -36,7 +39,7 @@ Win32 Microsoft nmake Win32 Visual Studio 2010 Express IDE 1. install MSVC 2010 Express Version from http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express -2. install cmake and libexpat +2. install cmake, libexpat and optional xsltproc and docbook dtd and stylesheets 3. get dbus sources 4. unpack dbus sources into a sub directory (referred as later) 5. mkdir dbus-build @@ -50,7 +53,7 @@ Win32 Visual Studio 2010 Express IDE Win32 Visual Studio 2010 Professional IDE 1. install MSVC 2010 Professional Version -2. install cmake and libexpat +2. install cmake, libexpat and optional xsltproc and docbook dtd and stylesheets 3. get dbus sources 4. unpack dbus sources into a sub directory (referred as later) 5. mkdir dbus-build @@ -63,7 +66,7 @@ Win32 Visual Studio 2010 Professional IDE devenv dbus.sln /build Linux -1. install cmake and libexpat +2. install cmake, libexpat and optional xsltproc and docbook dtd and stylesheets 2. get dbus sources 3. unpack dbus sources into a sub directory (referred as later) 4. mkdir dbus-build @@ -82,6 +85,12 @@ When using the cmake build system the dbus-specific configuration flags that can to the cmake program are these (use -D= on command line). The listed values are the defaults (in a typical build - some are platform-specific). +// in case cmake is not able to determine the xsltproc executable (optional) +XSLTPROC_EXECUTABLE== 2012): // Enable code analyzing for MSVC compiler: /analyze DBUS_MSVC_ANALYZE:BOOL=OFF - -Note: The above mentioned options could be extracted after -configuring from the output of running " help-options" -in the build directory. The related entries start with -CMAKE_ or DBUS_. +Note: Above mentioned options starting with DBUS_ or CMAKE_ could +be extracted after configuring from the output of running +" help-options" in the build directory. How to compile in dbus into clients with cmake