]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure we can deal with empty variables when parsing copyright years. 7258/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 4 Oct 2018 15:15:31 +0000 (09:15 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 4 Oct 2018 15:15:31 +0000 (09:15 -0600)
doc/doxygen/CMakeLists.txt

index e5b780918e79e0425f68bae3dfe02cdb7cf82df8..6e067ebc8f575d13b928a6ac2916ea9da014c5c1 100644 (file)
@@ -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})

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.