From ebe02f94afccbe0b11ce6d382626369d85ee9be7 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 18 Mar 2013 21:21:12 +0100 Subject: [PATCH] Added CMake target for documentation. --- CMakeLists.txt | 11 ++++++++--- docs/CMakeLists.txt | 5 +++++ docs/Doxyfile.in | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 docs/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index e3588dec..56e31736 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,11 +14,12 @@ option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON) option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON) option(BUILD_SHARED_LIBS "Build shared libraries" OFF) -option(GLFW_DOCUMENT_INTERNALS "Include documentation of internal functions" OFF) +set(DOXYGEN_SKIP_DOT TRUE) +find_package(Doxygen) -set(GLFW_DOC_HEADERS "${GLFW_SOURCE_DIR}/include/GL/glfw3.h ${GLFW_SOURCE_DIR}/include/GL/glfw3native.h") +option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) if (GLFW_DOCUMENT_INTERNALS) - set(GLFW_DOC_HEADERS "${GLFW_DOC_HEADERS} ${GLFW_SOURCE_DIR}/src/internal.h") + set(GLFW_DOC_HEADERS "${GLFW_SOURCE_DIR}/src/internal.h") endif() if (APPLE) @@ -355,6 +356,10 @@ if (GLFW_BUILD_TESTS) add_subdirectory(tests) endif() +if (DOXYGEN_FOUND) + add_subdirectory(docs) +endif() + #-------------------------------------------------------------------- # Create generated files #-------------------------------------------------------------------- diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 00000000..bebd1840 --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1,5 @@ + +add_custom_target(docs ${DOXYGEN_EXECUTABLE} + WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs + COMMENT "Generating HTML documentation" VERBATIM) + diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index 271036b5..7edc6675 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -656,7 +656,7 @@ WARN_LOGFILE = @GLFW_BINARY_DIR@/docs/warnings.txt # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @GLFW_DOC_HEADERS@ @GLFW_SOURCE_DIR@/docs/ +INPUT = @GLFW_DOC_HEADERS@ @GLFW_SOURCE_DIR@/include/GL/ @GLFW_SOURCE_DIR@/docs/ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -674,7 +674,7 @@ INPUT_ENCODING = UTF-8 # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py # *.f90 *.f *.for *.vhd *.vhdl -FILE_PATTERNS = *.dox +FILE_PATTERNS = *.h *.dox # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO.