* cmake\doc\CMakeLists.txt: added prelimary xml doc support, needs cmake find script.
authorRalf Habacker <ralf.habacker@freenet.de>
Thu, 15 Mar 2007 12:10:07 +0000 (12:10 +0000)
committerRalf Habacker <ralf.habacker@freenet.de>
Thu, 15 Mar 2007 12:10:07 +0000 (12:10 +0000)
ChangeLog
cmake/CMakeLists.txt
cmake/doc/CMakeLists.txt

index b258353..a79e321 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-15 Ralf.Habacker  <ralf.habacker@freenet.de>
+
+       * cmake\doc\CMakeLists.txt: added prelimary xml doc 
+       support, needs cmake Find script.
+
 2007-03-14 Ralf.Habacker  <ralf.habacker@freenet.de>
 
        * cmake: add doxygen support
index e682a17..ccd63e0 100644 (file)
@@ -225,9 +225,6 @@ OPTION(DBUS_DISABLE_ASSERTS "Disable assertion checking" OFF)
 #AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes)
 OPTION(DBUS_DISABLE_CHECKS "Disable public API sanity checking" OFF)
 
-#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
-
 #AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),enable_gcov=$enableval,enable_gcov=no)
 OPTION(DBUS_GCOV_ENABLED "compile with coverage profiling instrumentation (gcc only)" OFF)
 if(DBUS_GCOV_ENABLED)
index 88ef67a..dd46708 100644 (file)
@@ -4,11 +4,81 @@ if(DOXYGEN_EXECUTABLE)
   OPTION(DBUS_ENABLE_DOXYGEN_DOCS "build DOXYGEN documentation (requires Doxygen)" ON)
 endif(DOXYGEN_EXECUTABLE)
 
-
-set (top_srcdir ${CMAKE_SOURCE_DIR}/..)
-configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_BINARY_DIR}/Doxyfile )
 if (DBUS_ENABLE_DOXYGEN_DOCS)
+    set (top_srcdir ${CMAKE_SOURCE_DIR}/..)
+    configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_BINARY_DIR}/Doxyfile )
     add_custom_target(doc 
         COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile
     )
 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
+
+# depends on xmlto
+set(DBUS_XML_DOCS_ENABLED 0)
+
+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
+)
+
+set (HTML_FILES
+       dbus-faq.html                   
+       dbus-specification.html 
+       dbus-test-plan.html             
+       dbus-tutorial.html
+)
+
+if (DBUS_XML_DOCS_ENABLED)
+
+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}
+  )
+endmacro (DOCBOOK)
+
+### copy tests to builddir so that generated tests and static tests 
+### are all in one place.
+### todo how to add more filetypes 
+MACRO (COPYDIR _src _type)
+    FOREACH(FILE_TYPE ${_type})
+       FOREACH(DIR ${_src})
+               FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${DIR}/${FILE_TYPE}" )
+               FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DIR})
+               FOREACH(FILE ${FILES})
+                       GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME)
+                       SET (TARGET ${CMAKE_BINARY_DIR}/${DIR}/${FILENAME})
+                       configure_file(${FILE} ${TARGET} COPYONLY)
+                       IF (CONFIG_VERBOSE)
+                               MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
+                       ENDIF (CONFIG_VERBOSE)
+               ENDFOREACH(FILE)
+       ENDFOREACH(DIR)
+    ENDFOREACH(FILE_TYPE)
+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)
+
+endif(DBUS_XML_DOCS_ENABLED)