[evolution-data-server/wip/cmake] docs/ directory



commit 688816a01aa349907ec720f41f4c202512254227
Author: Milan Crha <mcrha redhat com>
Date:   Wed Sep 28 21:39:39 2016 +0200

    docs/ directory

 CMakeLists.txt                                     |    8 +-
 cmake/modules/GtkDoc.cmake                         |  121 ++++++++++++++++++++
 docs/CMakeLists.txt                                |    1 +
 docs/reference/CMakeLists.txt                      |    6 +
 docs/reference/camel/CMakeLists.txt                |   34 ++++++
 .../camel/{camel-docs.sgml => camel-docs.sgml.in}  |    8 +-
 docs/reference/camel/tree_index.sgml               |   66 -----------
 docs/reference/eds/CMakeLists.txt                  |   44 +++++++
 docs/reference/eds/eds-cursor-example.sgml.in      |   10 +-
 .../eds/{eds-docs.sgml => eds-docs.sgml.in}        |    5 +-
 docs/reference/eds/version.xml.in                  |    1 -
 docs/reference/private/CMakeLists.txt              |   13 ++
 .../private/libedbus-private-docs.sgml.in          |   28 +++---
 13 files changed, 247 insertions(+), 98 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8b36116..843c242 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -215,6 +215,7 @@ include(CheckTarget)
 include(DistTarget)
 include(GLibTools)
 include(GObjectIntrospection)
+include(GtkDoc)
 include(InstalledTests)
 include(PkgConfigEx)
 include(SetupBuildFlags)
@@ -227,6 +228,7 @@ include(FindPhonenumber)
 include(FindSMIME)
 
 add_printable_option(ENABLE_MAINTAINER_MODE "Enable maintainer mode" OFF)
+add_printable_option(WITH_PRIVATE_DOCS "Build documentation for private libraries (requires 
-DENABLE-GTK-DOC=ON" OFF)
 
 if(ENABLE_MAINTAINER_MODE)
        set(BUILD_TESTING ON)
@@ -902,9 +904,9 @@ if(HAVE_GTK)
        add_subdirectory(libedataserverui)
 endif(HAVE_GTK)
 
-#if(ENABLE_GTK_DOC)
-#      add_subdirectory(doc)
-#endif(ENABLE_GTK_DOC)
+if(ENABLE_GTK_DOC)
+       add_subdirectory(docs)
+endif(ENABLE_GTK_DOC)
 
 if(ENABLE_EXAMPLES)
        add_subdirectory(examples)
diff --git a/cmake/modules/GtkDoc.cmake b/cmake/modules/GtkDoc.cmake
new file mode 100644
index 0000000..0215c9c
--- /dev/null
+++ b/cmake/modules/GtkDoc.cmake
@@ -0,0 +1,121 @@
+# GtkDoc.cmake
+
+include(PrintableOptions)
+
+add_printable_option(ENABLE_GTK_DOC "Use gtk-doc to build documentation" OFF)
+
+if(NOT ENABLE_GTK_DOC)
+       return()
+endif(NOT ENABLE_GTK_DOC)
+
+find_program(GTKDOC_SCAN gtkdoc-scan)
+find_program(GTKDOC_MKDB gtkdoc-mkdb)
+find_program(GTKDOC_MKHTML gtkdoc-mkhtml)
+find_program(GTKDOC_FIXXREF gtkdoc-fixxref)
+
+if(NOT (GTKDOC_SCAN AND GTKDOC_MKDB AND GTKDOC_MKHTML AND GTKDOC_FIXXREF))
+       message(FATAL_ERROR "Cannot find all gtk-doc binaries, install them or use -DENABLE_GTK_DOC=OFF 
instead")
+       return()
+endif()
+
+# To regenerate libical-glib-docs.xml.in from current sources use these steps:
+#   a) delete ${CMAKE_CURRENT_BINARY_DIR}/libical-glib-docs.xml
+#   b) go to ${CMAKE_CURRENT_BINARY_DIR} and run command:
+#      gtkdoc-scan --module=libical-glib --source-dir=../../../src/libical-glib/
+#                  --deprecated-guards="LIBICAL_GLIB_DISABLE_DEPRECATED"
+#                  --ignore-headers=libical-glib-private.h --rebuild-sections --rebuild-types
+#   c) generate the libical-glib-docs.xml file with command:
+#      gtkdoc-mkdb --module=libical-glib --output-format=xml
+#                  --source-dir=../../../src/libical-glib/ --xml-mode --name-space=i-cal
+#   d) copy the newly created libical-glib-docs.xml
+#      to ${CURRENT_SOURCE_DIR}/libical-glib-docs.xml.in
+#   e) compare the changes in the file and return back what should be left,
+#      like the replacement of the "[Insert title here]" and the <bookinfo/> content
+
+if(NOT TARGET gtkdoc)
+       add_custom_target(gtkdocs ALL)
+endif(NOT TARGET gtkdoc)
+
+# add_gtkdoc_rules
+#    Add rules to build developer documentation using gtk-doc for some part.
+#    Arguments:
+#       _module - the module name, like 'camel'; it expects ${_part}-docs.sgml.in in the 
CMAKE_CURRENT_SOURCE_DIR
+#       _namespace - namespace for symbols
+#       _deprecated_guards - define name, which guards deprecated symbols
+#       _srcdirsvar - variable with dirs where the source files are located
+#       _depsvar - a variable with dependencies (targets)
+#       _ignoreheadersvar - a variable with a set of header files to ignore
+
+macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ignoreheadersvar)
+       configure_file(
+               ${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in
+               ${CMAKE_CURRENT_BINARY_DIR}/${_module}-docs.sgml
+               @ONLY
+       )
+
+       set(OUTPUT_DOCDIR ${SHARE_INSTALL_DIR}/gtk-doc/html/${_module})
+
+       set(_ignore_headers)
+       foreach(_header ${${_ignoreheadersvar}})
+               set(_ignore_headers "${_ignore_headers} ${_header}")
+       endforeach(_header)
+
+       set(_filedeps)
+       set(_srcdirs)
+       foreach(_srcdir ${${_srcdirsvar}})
+               set(_srcdirs ${_srcdirs} --source-dir="${_srcdir}")
+               file(GLOB _files ${_srcdir}/*.h* ${_srcdir}/*.c*)
+               list(APPEND _filedeps ${_files})
+       endforeach(_srcdir)
+
+       set(_mkhtml_prefix "")
+       if(APPLE)
+               set(_mkhtml_prefix "cmake -E env XML_CATALOG_FILES=\"/usr/local/etc/xml/catalog\"")
+       endif(APPLE)
+
+       add_custom_command(OUTPUT html/index.html
+               COMMAND ${GTKDOC_SCAN}
+                       --module=${_module}
+                       --deprecated-guards="${_deprecated_guards}"
+                       --ignore-headers="${_ignore_headers}"
+                       --rebuild-sections
+                       --rebuild-types
+                       ${_srcdirs}
+
+               COMMAND ${GTKDOC_MKDB}
+                       --module=${_module}
+                       --name-space=${_namespace}
+                       --main-sgml-file="${CMAKE_CURRENT_BINARY_DIR}/${_module}-docs.sgml"
+                       --sgml-mode
+                       --output-format=xml
+                       ${_srcdirs}
+
+               COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/html"
+
+               COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/html" ${_mkhtml_prefix} 
${GTKDOC_MKHTML} --path=.. ${_module} ../${_module}-docs.sgml
+
+               COMMAND ${GTKDOC_FIXXREF}
+                       --module=${_module}
+                       --module-dir=.
+                       --extra-dir=..
+                       --html-dir="${OUTPUT_DOCDIR}"
+
+               DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_module}-docs.sgml"
+                       ${_filedeps}
+               COMMENT "Generating ${_module} documentation"
+       )
+
+       add_custom_target(${_module}-gtkdoc
+               DEPENDS html/index.html
+       )
+
+       if(${_depsvar})
+               add_dependencies(${_module}-gtkdoc ${${_depsvar}})
+       endif(${_depsvar})
+
+       add_dependencies(gtkdocs ${_module}-gtkdoc)
+
+       install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
+               DESTINATION ${OUTPUT_DOCDIR}
+       )
+endmacro(add_gtkdoc)
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 0000000..90bb2b5
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(reference)
diff --git a/docs/reference/CMakeLists.txt b/docs/reference/CMakeLists.txt
new file mode 100644
index 0000000..1907a13
--- /dev/null
+++ b/docs/reference/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_subdirectory(eds)
+add_subdirectory(camel)
+
+if(WITH_PRIVATE_DOCS)
+       add_subdirectory(private)
+endif(WITH_PRIVATE_DOCS)
diff --git a/docs/reference/camel/CMakeLists.txt b/docs/reference/camel/CMakeLists.txt
new file mode 100644
index 0000000..da02752
--- /dev/null
+++ b/docs/reference/camel/CMakeLists.txt
@@ -0,0 +1,34 @@
+set(SOURCEDIRS
+       ${CMAKE_SOURCE_DIR}/camel
+       ${CMAKE_SOURCE_DIR}/camel/providers/local
+       ${CMAKE_SOURCE_DIR}/camel/providers/imapx
+       ${CMAKE_SOURCE_DIR}/camel/providers/nntp
+       ${CMAKE_SOURCE_DIR}/camel/providers/pop3
+       ${CMAKE_SOURCE_DIR}/camel/providers/sendmail
+       ${CMAKE_SOURCE_DIR}/camel/providers/smtp
+)
+
+set(DEPENDENCIES
+       camel
+       camellocal
+       camelimapx
+       camelnntp
+       camelpop3
+       camelsendmail
+       camelsmtp
+)
+
+set(IGNORE_HEADERS
+       camel-charset-map-private.h
+       camel-enumtypes.h
+       camel-i18n.h
+       camel-imapx-tokenise.h
+       camel-imapx-utils.h
+       camel-local-private.h
+       camel-nntp-private.h
+       camel-nntp-resp-codes.h
+       camel-search-private.h
+       camel-win32.h
+)
+
+add_gtkdoc(camel camel "CAMEL_DISABLE_DEPRECATED" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/docs/reference/camel/camel-docs.sgml b/docs/reference/camel/camel-docs.sgml.in
similarity index 98%
rename from docs/reference/camel/camel-docs.sgml
rename to docs/reference/camel/camel-docs.sgml.in
index 2df9f3d..65cdf98 100644
--- a/docs/reference/camel/camel-docs.sgml
+++ b/docs/reference/camel/camel-docs.sgml.in
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"; [
 <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
 ]>
@@ -27,7 +27,7 @@
 
     <abstract>
       <para>This manual documents the interfaces of the Camel
-      library.</para>
+      library @PROJECT_VERSION@.</para>
     </abstract>
   </bookinfo>
 
@@ -276,10 +276,6 @@
 
   </part>
 
-  <chapter id="ClassTree">
-    <title>Class Hierarchy</title>
-    <xi:include href="xml/tree_index.sgml"/>
-  </chapter>
   <index id="api-index-full">
     <title>Index</title>
     <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
diff --git a/docs/reference/eds/CMakeLists.txt b/docs/reference/eds/CMakeLists.txt
new file mode 100644
index 0000000..c618c96
--- /dev/null
+++ b/docs/reference/eds/CMakeLists.txt
@@ -0,0 +1,44 @@
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eds-cursor-example.sgml.in
+       ${CMAKE_CURRENT_BINARY_DIR}/xml/eds-cursor-example.sgml
+       @ONLY
+)
+
+set(SOURCEDIRS
+       ${CMAKE_SOURCE_DIR}/libebackend
+       ${CMAKE_SOURCE_DIR}/libedataserver
+       ${CMAKE_BINARY_DIR}/libedataserver
+       ${CMAKE_SOURCE_DIR}/addressbook/libebook
+       ${CMAKE_SOURCE_DIR}/addressbook/libebook-contacts
+       ${CMAKE_SOURCE_DIR}/addressbook/libedata-book
+       ${CMAKE_SOURCE_DIR}/calendar/libecal
+       ${CMAKE_SOURCE_DIR}/calendar/libedata-cal
+       ${CMAKE_SOURCE_DIR}/tests/test-server-utils
+)
+
+set(DEPENDENCIES
+       ebackend
+       edataserver
+       ebook
+       ebook-contacts
+       edata-book
+       ecal
+       edata-cal
+       etestserverutils
+)
+
+set(IGNORE_HEADERS
+       e-alphabet-index-private.h
+       e-backend-enumtypes.h
+       e-book-enumtypes.h
+       e-book-contacts-enumtypes.h
+       e-cal-enumtypes.h
+       e-client-private.h
+       e-data-cal-types.h
+       e-phone-number-private.h
+       e-source-enumtypes.h
+       e-transliterator-private.h
+       libedataserver-private.h
+       ximian-vcard.h
+)
+
+add_gtkdoc(eds e "EDS_DISABLE_DEPRECATED" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/docs/reference/eds/eds-cursor-example.sgml.in b/docs/reference/eds/eds-cursor-example.sgml.in
index a29e7b1..5cb83b1 100644
--- a/docs/reference/eds/eds-cursor-example.sgml.in
+++ b/docs/reference/eds/eds-cursor-example.sgml.in
@@ -70,7 +70,7 @@
       <programlisting>
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";
                     parse="text"
-                    href="@SRCDIR@/examples/cursor/cursor-example.c"/>
+                    href="@CMAKE_SOURCE_DIR@/examples/cursor/cursor-example.c"/>
       </programlisting>
     </informalexample>
   </refsect1>
@@ -88,7 +88,7 @@
       <programlisting>
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";
                     parse="text"
-                    href="@SRCDIR@/examples/cursor/cursor-navigator.c"/>
+                    href="@CMAKE_SOURCE_DIR@/examples/cursor/cursor-navigator.c"/>
       </programlisting>
     </informalexample>
   </refsect1>
@@ -106,7 +106,7 @@
       <programlisting>
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";
                     parse="text"
-                    href="@SRCDIR@/examples/cursor/cursor-search.c"/>
+                    href="@CMAKE_SOURCE_DIR@/examples/cursor/cursor-search.c"/>
       </programlisting>
     </informalexample>
   </refsect1>
@@ -122,7 +122,7 @@
       <programlisting>
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";
                     parse="text"
-                    href="@SRCDIR@/examples/cursor/cursor-slot.c"/>
+                    href="@CMAKE_SOURCE_DIR@/examples/cursor/cursor-slot.c"/>
       </programlisting>
     </informalexample>
   </refsect1>
@@ -139,7 +139,7 @@
       <programlisting>
        <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";
                     parse="text"
-                    href="@SRCDIR@/examples/cursor/cursor-data.c"/>
+                    href="@CMAKE_SOURCE_DIR@/examples/cursor/cursor-data.c"/>
       </programlisting>
     </informalexample>
   </refsect1>
diff --git a/docs/reference/eds/eds-docs.sgml b/docs/reference/eds/eds-docs.sgml.in
similarity index 98%
rename from docs/reference/eds/eds-docs.sgml
rename to docs/reference/eds/eds-docs.sgml.in
index 8dcad26..02fcaa2 100644
--- a/docs/reference/eds/eds-docs.sgml
+++ b/docs/reference/eds/eds-docs.sgml.in
@@ -1,13 +1,12 @@
 <?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"; [
 <!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
-<!ENTITY version SYSTEM "version.xml">
 ]>
 <book id="index" xmlns:xi="http://www.w3.org/2001/XInclude";>
   <bookinfo>
     <title>Evolution-Data-Server Reference Manual</title>
-    <releaseinfo>Reference Manual for &version;</releaseinfo>
+    <releaseinfo>Reference Manual for @PACKAGE_VERSION@</releaseinfo>
     <abstract>
       <para>
        Evolution-Data-Server is a collection of libraries and services
diff --git a/docs/reference/private/CMakeLists.txt b/docs/reference/private/CMakeLists.txt
new file mode 100644
index 0000000..2825ce6
--- /dev/null
+++ b/docs/reference/private/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(SOURCEDIRS
+       ${CMAKE_BINARY_DIR}/private
+)
+
+set(DEPENDENCIES
+       edbus-private
+)
+
+set(IGNORE_HEADERS
+       e-dbus-localed.h
+)
+
+add_gtkdoc(libedbus-private e-dbus "EDS_DISABLE_DEPRECATED" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/docs/reference/private/libedbus-private-docs.sgml.in 
b/docs/reference/private/libedbus-private-docs.sgml.in
index 7d6999e..8052aa4 100644
--- a/docs/reference/private/libedbus-private-docs.sgml.in
+++ b/docs/reference/private/libedbus-private-docs.sgml.in
@@ -5,7 +5,7 @@
 ]>
 <book id="index" xmlns:xi="http://www.w3.org/2001/XInclude";>
   <bookinfo>
-    <title>Evolution-Data-Server Manual: Private</title>
+    <title>Evolution-Data-Server Manual: Private, version @PROJECT_VERSION@</title>
   </bookinfo>
 
   <chapter>
@@ -25,19 +25,19 @@
 
   <chapter>
     <title>D-Bus Interfaces</title>
-    <xi:include href="@SRCDIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.xml"/>
-    <xi:include href="@SRCDIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.Removable.xml"/>
-    <xi:include href="@SRCDIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.Writable.xml"/>
-    <xi:include 
href="@SRCDIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.RemoteCreatable.xml"/>
-    <xi:include 
href="@SRCDIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.RemoteDeletable.xml"/>
-    <xi:include 
href="@SRCDIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.OAuth2Support.xml"/>
-    <xi:include 
href="@SRCDIR@/private/e-dbus-source-manager-org.gnome.evolution.dataserver.SourceManager.xml"/>
-    <xi:include 
href="@SRCDIR@/private/e-dbus-authenticator-org.gnome.evolution.dataserver.Authenticator.xml"/>
-    <xi:include href="@SRCDIR@/private/e-dbus-address-book-org.gnome.evolution.dataserver.AddressBook.xml"/>
-    <xi:include 
href="@SRCDIR@/private/e-dbus-address-book-factory-org.gnome.evolution.dataserver.AddressBookFactory.xml"/>
-    <xi:include href="@SRCDIR@/private/e-dbus-calendar-org.gnome.evolution.dataserver.Calendar.xml"/>
-    <xi:include 
href="@SRCDIR@/private/e-dbus-calendar-factory-org.gnome.evolution.dataserver.CalendarFactory.xml"/>
-    <xi:include 
href="@SRCDIR@/private/e-dbus-user-prompter-org.gnome.evolution.dataserver.UserPrompter.xml"/>
+    <xi:include href="@CMAKE_BINARY_DIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.Removable.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.Writable.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.RemoteCreatable.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.RemoteDeletable.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-source-org.gnome.evolution.dataserver.Source.OAuth2Support.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-source-manager-org.gnome.evolution.dataserver.SourceManager.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-authenticator-org.gnome.evolution.dataserver.Authenticator.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-address-book-org.gnome.evolution.dataserver.AddressBook.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-address-book-factory-org.gnome.evolution.dataserver.AddressBookFactory.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-calendar-org.gnome.evolution.dataserver.Calendar.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-calendar-factory-org.gnome.evolution.dataserver.CalendarFactory.xml"/>
+    <xi:include 
href="@CMAKE_BINARY_DIR@/private/e-dbus-user-prompter-org.gnome.evolution.dataserver.UserPrompter.xml"/>
   </chapter>
 
   <index id="api-index-full">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]