Add targets to build documentation with instructions.
authorRomain Forlot <romain.forlot@iot.bzh>
Mon, 20 Mar 2017 12:44:45 +0000 (12:44 +0000)
committerRomain Forlot <romain.forlot@iot.bzh>
Mon, 20 Mar 2017 12:44:45 +0000 (12:44 +0000)
Change-Id: I037ab5d94e17147aba998131e92c1ec920293fa9
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
CAN_signaling.doxygen
CMakeLists.txt
README.md

index cf57f8b..85bfbd1 100644 (file)
@@ -31,7 +31,7 @@ DOXYFILE_ENCODING      = UTF-8
 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
 # the logo to the output directory.
 
-PROJECT_LOGO           = images/logo_iot_bzh.svg
+PROJECT_LOGO           = docs/images/logo_iot_bzh.svg
 
 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
 # double-quotes, unless you are using Doxywizard) that should identify the
@@ -39,7 +39,7 @@ PROJECT_LOGO           = images/logo_iot_bzh.svg
 # title of most generated pages and in a few other places.
 # The default value is: My Project.
 
-PROJECT_NAME           = "CAN_signaling"
+PROJECT_NAME           = "AGL: Low level CAN signaling binding"
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number. This
 # could be handy for archiving the generated documentation or if some version
index 233ee69..05fbd5f 100644 (file)
 cmake_minimum_required(VERSION 3.3)
 project(low-can-binding)
 add_subdirectory(src)
+
+add_custom_command(
+       OUTPUT ${PROJECT_NAME}.pdf
+       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+       COMMAND gitbook install
+       COMMAND gitbook pdf docs ${PROJECT_NAME}.pdf
+)
+add_custom_target(pdf
+       DEPENDS ${PROJECT_NAME}.pdf)
+
+add_custom_command(
+       OUTPUT _book
+       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+       COMMAND gitbook install
+       COMMAND gitbook serve
+)
+add_custom_target(serve
+       DEPENDS _book)
+
+add_custom_command(
+       OUTPUT docs_doxygen
+       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+       COMMAND doxygen CAN_signaling.doxygen
+)
+add_custom_target(doxygen
+       DEPENDS docs_doxygen)
\ No newline at end of file
index f346327..bcf9981 100644 (file)
--- a/README.md
+++ b/README.md
@@ -3,9 +3,47 @@
 Low level CAN bus binder, based upon OpenXC vi-firmware project.
 
 Full document can be found under `docs` directory.
-Note that your can use gitbook to serve documentation:
+
+# Generate documentation
+
+## Prerequisites
+
+You can use gitbook to serve documentation. To do so, please install it using *npm* as well as *calibre* package from your package distribution manager:
+
+```bash
+sudo npm install -g gitbook-cli
+sudo apt-get install calibre
+```
+
+To generate Doxygen documentation, you'll need doxygen and graphviz:
+
+```bash
+sudo apt-get doxygen graphviz
 ```
+
+Prepare your build environment:
+
+```bash
 mkdir build && cd build
 cmake ..
-make serve-docs
+```
+
+## Generation
+
+Generate a PDF version :
+
+```bash
+make pdf
+```
+
+Serve an HTML version, this will run a web server that will serve you locally documentation :
+
+```bash
+make serve
+```
+
+Generate doxygen documentation:
+
+```bash
+make doxygen
 ```
\ No newline at end of file