#
# Usage:
# DEAL_II_QUERY_GIT_INFORMATION()
+# DEAL_II_QUERY_GIT_INFORMATION("CUSTOM_PREFIX")
#
# This will try to gather information about current branch, as well as
# short and long revision. If ${CMAKE_SOURCE_DIR} is the root of a git
# GIT_SHORTREV
# GIT_TAG
#
-# If this macro is called within the deal.II build system the variables are
-# prefixed with DEAL_II_:
+# The macro can be called with an optional PREFIX argument to prefix the
+# variables:
#
-# DEAL_II_GIT_BRANCH
-# DEAL_II_GIT_REVISION
-# DEAL_II_GIT_SHORTREV
-# DEAL_II_GIT_TAG
+# PREFIX_GIT_BRANCH
+# PREFIX_GIT_REVISION
+# PREFIX_GIT_SHORTREV
+# PREFIX_GIT_TAG
#
MACRO(DEAL_II_QUERY_GIT_INFORMATION)
MESSAGE(STATUS "Query git repository information.")
- #
- # If DEAL_II_BASE_NAME is defined and DEAL_II_PROJECT_CONFIG_INCLUDED was
- # not set, we assume that we are called from within the deal.II build
- # system. In this case we prepend all variables by "DEAL_II_"
- #
- IF( DEFINED DEAL_II_BASE_NAME AND
- NOT DEFINED DEAL_II_PROJECT_CONFIG_INCLUDED )
- SET(_prefix "DEAL_II_")
- ELSE()
- SET(_prefix "")
+ # Set prefix.
+ SET(_prefix "")
+ IF(NOT "${ARGN}" STREQUAL "")
+ SET(_prefix "${ARGN}_")
ENDIF()
FIND_PACKAGE(Git)
# #
########################################################################
-DEAL_II_QUERY_GIT_INFORMATION()
+DEAL_II_QUERY_GIT_INFORMATION("DEAL_II")
FILE(WRITE ${CMAKE_BINARY_DIR}/revision.log
"###