]> https://gitweb.dealii.org/ - dealii.git/commitdiff
install git scripts and use get_latest_tag.sh to get Git tag 4407/head
authorDenis Davydov <davydden@gmail.com>
Wed, 24 May 2017 05:47:17 +0000 (07:47 +0200)
committerDenis Davydov <davydden@gmail.com>
Thu, 25 May 2017 06:32:33 +0000 (08:32 +0200)
cmake/macros/macro_deal_ii_query_git_information.cmake
cmake/scripts/CMakeLists.txt

index 32354ac21101b936cb68e67c18021dc06e4df73c..d6c25e34d1dc456b1d9db06965058b9b606a30ea 100644 (file)
@@ -109,24 +109,25 @@ MACRO(DEAL_II_QUERY_GIT_INFORMATION)
     #
     # Query for tag:
     #
-
-    EXECUTE_PROCESS(
-       COMMAND ${GIT_EXECUTABLE} rev-list --tags --max-count=1
-       WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-       OUTPUT_VARIABLE _tag
-       RESULT_VARIABLE _result
-       OUTPUT_STRIP_TRAILING_WHITESPACE
-       )
-
-    EXECUTE_PROCESS(
-       COMMAND ${GIT_EXECUTABLE} describe --tags ${_tag}
-       WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-       OUTPUT_VARIABLE _tag
-       RESULT_VARIABLE _result
-       OUTPUT_STRIP_TRAILING_WHITESPACE
-       )
-    IF(${_result} EQUAL 0)
-      SET(${_prefix}GIT_TAG ${_tag})
+    SET(_script "")
+    IF(EXISTS     ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh)
+      SET(_script ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh)
+    ELSEIF(EXISTS ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh)
+      SET(_script ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/get_latest_tag.sh)
+    ENDIF()
+    IF(NOT "${_script}" STREQUAL "")
+       EXECUTE_PROCESS(
+          COMMAND ${_script}
+          WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+          OUTPUT_VARIABLE _tag
+          RESULT_VARIABLE _result
+          OUTPUT_STRIP_TRAILING_WHITESPACE
+          )
+       IF(${_result} EQUAL 0)
+         SET(${_prefix}GIT_TAG ${_tag})
+       ENDIF()
+    ELSE()
+       MESSAGE(STATUS "Could not locate get_latest_tag.sh. " ${_prefix}GIT_TAG " will not be set.")
     ENDIF()
 
   ENDIF()
index 565f1c0eeea85f43c24683d1808c22dae310d913..24ec784f4460df1ca84f5e0de4f84e5ba513342a 100644 (file)
@@ -49,6 +49,8 @@ SET(_scripts
   ${CMAKE_CURRENT_SOURCE_DIR}/normalize.pl
   ${CMAKE_CURRENT_SOURCE_DIR}/run_test.cmake
   ${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh
+  ${CMAKE_CURRENT_SOURCE_DIR}/get_closest_tag.sh
+  ${CMAKE_CURRENT_SOURCE_DIR}/get_latest_tag.sh
   )
 FILE(COPY ${_scripts}
   DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_SHARE_RELDIR}/scripts

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.