]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: Avoid --date=iso-strict for git versions older than 2.2 14206/head
authorMatthias Maier <tamiko@43-1.org>
Sat, 20 Aug 2022 20:49:51 +0000 (15:49 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sat, 20 Aug 2022 20:49:51 +0000 (15:49 -0500)
cmake/macros/macro_deal_ii_query_git_information.cmake

index 1d1f11a4a2b431f0100a4d56f04712db2036ac51..11ab27193bbe2f478a6e5a0fef879d99ce4b098f 100644 (file)
@@ -83,8 +83,14 @@ MACRO(DEAL_II_QUERY_GIT_INFORMATION)
     #   %cd  - the commit date (for which we use the strict iso date format)
     #
 
+    # --date=iso-strict has been introduced in git 2.2 (released Dec 2014)
+    SET(_date_format)
+    IF(NOT ${GIT_VERSION_STRING} VERSION_LESS 2.2)
+      SET(_date_format "--date=iso-strict")
+    ENDIF()
+
     EXECUTE_PROCESS(
-       COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"revision=%H, shortrev=%h, date=%cd" --date=iso-strict
+       COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"revision=%H, shortrev=%h, date=%cd" ${_date_format}
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
        OUTPUT_VARIABLE _info
        RESULT_VARIABLE _result

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.