Skip to content

Commit

Permalink
Add Doxygen "docs" target to CMake build
Browse files Browse the repository at this point in the history
Must be explicitly enabled using -DBUILD_DOCUMENTATION=YES

Direct all warnings to a log file that can be grepped for specific
errors as part of a CI build.

Fixes libgeos#902
  • Loading branch information
dbaston committed Sep 9, 2019
1 parent 32af813 commit 140c81a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ dnl -- JTS_PORT: the version of JTS this release is bound to
dnl JTS_PORT=1.13.0
JTS_PORT=`cat $VERTXT | awk -F= '/^JTS_PORT/ {print $2}'`

DOXYGEN_LOGFILE=
AC_SUBST(DOXYGEN_LOGFILE)

dnl Hush warnings
AC_DEFINE(USE_UNSTABLE_GEOS_CPP_API, [1], [We know])
Expand Down
22 changes: 22 additions & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Part of CMake configuration for GEOS
#
# Copyright (C) 2018 Mateusz Loskot <[email protected]>
# Copyright (C) 2019 Daniel Baston <[email protected]>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU Lesser General Public Licence as published
Expand All @@ -15,3 +16,24 @@ target_link_libraries(example PRIVATE geos)
target_include_directories(test_geos_unit
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>)

option(BUILD_DOCUMENTATION "Build Doxygen documentation" OFF)

if(BUILD_DOCUMENTATION)
find_package(Doxygen)

if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen was not found.")
endif()

set(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
set(DOXYGEN_LOGFILE ${CMAKE_CURRENT_BINARY_DIR}/doxygen_log)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
unset(srcdir)
unset(DOXYGEN_LOGFILE)

add_custom_target(docs
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
endif()
3 changes: 2 additions & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ WARN_FORMAT = "$file:$line: $text"
# messages should be written. If left blank the output is written to standard
# error (stderr).

WARN_LOGFILE =
WARN_LOGFILE = @DOXYGEN_LOGFILE@

#---------------------------------------------------------------------------
# Configuration options related to the input files
Expand Down Expand Up @@ -853,6 +853,7 @@ EXCLUDE_PATTERNS = */examples/* \
*/test/* \
*/bigtest/* \
*/io/markup/* \
*/ttmath/* \
config.h \
acconfig.h \
CoordinateList.cpp \
Expand Down
3 changes: 2 additions & 1 deletion tools/ci/script_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ source ${TRAVIS_BUILD_DIR}/tools/ci/common.sh

cmake --version

cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${TRAVIS_BUILD_DIR}
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_DOCUMENTATION=YES ${TRAVIS_BUILD_DIR}
run_make
cmake --build . --target docs
ctest --output-on-failure .

if [ "${BUILD_TYPE}" = "Coverage" ]; then
Expand Down

0 comments on commit 140c81a

Please sign in to comment.