]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Add generating dbus.devhelp2 to cmake build system
authorRalf Habacker <ralf.habacker@freenet.de>
Fri, 16 Nov 2018 22:01:03 +0000 (23:01 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Fri, 16 Nov 2018 22:01:56 +0000 (23:01 +0100)
cmake/doc/CMakeLists.txt

index f21e84e7af92f58de4ca831f1768084edad73d8b..11634e1b1189d350074ec34859c08f459618b9f3 100644 (file)
@@ -1,3 +1,5 @@
+SET(DOC_DIR ${CMAKE_SOURCE_DIR}/../doc)
+
 find_package(Doxygen)
 
 if(DOXYGEN_EXECUTABLE)
@@ -7,12 +9,31 @@ endif(DOXYGEN_EXECUTABLE)
 if (DBUS_ENABLE_DOXYGEN_DOCS)
     set (top_srcdir ${CMAKE_SOURCE_DIR}/..)
     configure_file(${CMAKE_SOURCE_DIR}/../Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile )
-    add_custom_target(doc 
+    add_custom_command(
+        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/api/html/index.html
         COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
         WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     )
+    add_custom_target(doc
+        DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/api/html/index.html ${CMAKE_CURRENT_BINARY_DIR}/dbus.devhelp2
+    )
 endif (DBUS_ENABLE_DOXYGEN_DOCS)
 
+find_program(XSLTPROC_EXECUTABLE xsltproc)
+if(XSLTPROC_EXECUTABLE)
+    message(STATUS "${XSLTPROC_EXECUTABLE} found")
+    set(DBUS_HAVE_XSLTPROC 1)
+endif()
+
+if(DBUS_HAVE_XSLTPROC)
+    add_custom_command(
+        OUTPUT dbus.devhelp2
+        COMMAND ${XSLTPROC_EXECUTABLE} -o dbus.devhelp2 ${DOC_DIR}/doxygen_to_devhelp.xsl api/xml/index.xml
+        DEPENDS ${DOC_DIR}/doxygen_to_devhelp.xsl api/html/index.html
+        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    )
+endif()
+
 #
 # find docbook generator
 #