From: Wolfgang Bangerth Date: Thu, 4 Oct 2018 15:15:31 +0000 (-0600) Subject: Make sure we can deal with empty variables when parsing copyright years. X-Git-Tag: v9.1.0-rc1~664^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7258%2Fhead;p=dealii.git Make sure we can deal with empty variables when parsing copyright years. --- diff --git a/doc/doxygen/CMakeLists.txt b/doc/doxygen/CMakeLists.txt index e5b780918e..6e067ebc8f 100644 --- a/doc/doxygen/CMakeLists.txt +++ b/doc/doxygen/CMakeLists.txt @@ -118,11 +118,13 @@ FILE(GLOB _source_files "${CMAKE_SOURCE_DIR}/examples/*/*.cc") FOREACH (_source ${_source_files}) FILE(READ "${_source}" contents) - STRING(REGEX MATCH "Copyright .C. +([0-9]+ - )?([0-9]+)" _copyright ${contents}) - STRING(REGEX MATCH "[0-9]+\$" _year ${_copyright}) + STRING(REGEX MATCH "Copyright .C. +([0-9]+ - )?([0-9]+)" _copyright "${contents}") + IF (NOT _copright STREQUAL "") + STRING(REGEX MATCH "[0-9]+\$" _year "${_copyright}") - IF (_year GREATER _last_year) - SET (_last_year "${_year}") + IF (NOT _year STREQUAL "" AND _year GREATER _last_year) + SET (_last_year "${_year}") + ENDIF() ENDIF() ENDFOREACH() SET(DEAL_II_PACKAGE_YEAR ${_last_year})