From fc6756b1fb33e265db0cdf0daf94141471232998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Mon, 10 Dec 2018 23:45:53 +0100 Subject: [PATCH] Add doxygen to build system --- CMakeLists.txt | 1 + doxygen/CMakeLists.txt | 10 ++++++++++ doxygen/Doxyconfig | 4 ++-- doxygen/build-doxygen.sh | 20 ++++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 doxygen/CMakeLists.txt create mode 100755 doxygen/build-doxygen.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index ed34bc9..c087a1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ pkg_check_modules(GTK3 REQUIRED gtk+-3.0) pkg_check_modules(CAIRO REQUIRED cairo) add_subdirectory(glade) +add_subdirectory(doxygen) include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS}) link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS}) diff --git a/doxygen/CMakeLists.txt b/doxygen/CMakeLists.txt new file mode 100644 index 0000000..a478f82 --- /dev/null +++ b/doxygen/CMakeLists.txt @@ -0,0 +1,10 @@ +find_package(Doxygen) +if (DOXYGEN_FOUND) + add_custom_target(doxygen + COMMAND ./build-doxygen.sh "${PROJECT_BINARY_DIR}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating documentation with Doxygen") + +else (DOXYGEN_FOUND) + message("Doxygen need to be installed to generate the doxygen documentation") +endif (DOXYGEN_FOUND) diff --git a/doxygen/Doxyconfig b/doxygen/Doxyconfig index 28ecff4..34028a7 100644 --- a/doxygen/Doxyconfig +++ b/doxygen/Doxyconfig @@ -38,7 +38,7 @@ PROJECT_NAME = GDS-Render # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = $(PROJECT_NUMBER) # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -58,7 +58,7 @@ PROJECT_LOGO = ../icon/gds-render.svg # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ./output +OUTPUT_DIRECTORY = $(OUTPUT_DIRECTORY) # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and diff --git a/doxygen/build-doxygen.sh b/doxygen/build-doxygen.sh new file mode 100755 index 0000000..04cd970 --- /dev/null +++ b/doxygen/build-doxygen.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )" +cd "$DIR" + +export PROJECT_NUMBER=`git describe --tags` + +if [ $# != 1 ]; then + export OUTPUT_DIRECTORY="./output" +else + export OUTPUT_DIRECTORY="$1" +fi + +doxygen Doxyconfig