From 84ed7759243e775778c4f2a1dae67a148543470f Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 21 Jan 2015 18:48:47 +0100 Subject: [PATCH] CMake: allow to call DEAL_II_QUERY_GIT_INFORMATION from user projects This commit enables to use the DEAL_II_QUERY_GIT_INFORMATION macro from within user projects. In this case the variable prefix "DEAL_II_" is ommited --- cmake/config/CMakeLists.txt | 10 ++++---- .../macro_deal_ii_query_git_information.cmake | 25 ++++++++++++++++--- doc/news/changes.h | 7 ++++++ 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/cmake/config/CMakeLists.txt b/cmake/config/CMakeLists.txt index 621a79b799..84a7aedafd 100644 --- a/cmake/config/CMakeLists.txt +++ b/cmake/config/CMakeLists.txt @@ -42,16 +42,16 @@ CONFIGURE_FILE( # for binary dir: # # ######################################################################## -FILE(COPY # for binary dir: +SET(_macros ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_invoke_autopilot.cmake ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_setup_target.cmake + ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_query_git_information.cmake + ) +FILE(COPY ${_macros} DESTINATION ${CMAKE_BINARY_DIR}/${DEAL_II_CMAKE_MACROS_RELDIR} ) -INSTALL(FILES # for installation: - ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_initialize_cached_variables.cmake - ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_invoke_autopilot.cmake - ${CMAKE_SOURCE_DIR}/cmake/macros/macro_deal_ii_setup_target.cmake +INSTALL(FILES ${_macros} DESTINATION ${DEAL_II_CMAKE_MACROS_RELDIR} COMPONENT library ) diff --git a/cmake/macros/macro_deal_ii_query_git_information.cmake b/cmake/macros/macro_deal_ii_query_git_information.cmake index 6ca84c01f2..aa536b9c64 100644 --- a/cmake/macros/macro_deal_ii_query_git_information.cmake +++ b/cmake/macros/macro_deal_ii_query_git_information.cmake @@ -24,6 +24,13 @@ # short and long revision. If ${CMAKE_SOURCE_DIR} is the root of a git # repository the following variables will be populated: # +# GIT_BRANCH +# GIT_REVISION +# GIT_SHORTREV +# +# If this macro is called within the deal.II build system the variables are +# prefixed with DEAL_II_: +# # DEAL_II_GIT_BRANCH # DEAL_II_GIT_REVISION # DEAL_II_GIT_SHORTREV @@ -33,6 +40,18 @@ 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 "") + ENDIF() + FIND_PACKAGE(Git) # @@ -70,9 +89,9 @@ MACRO(DEAL_II_QUERY_GIT_INFORMATION) ) IF(${_result} EQUAL 0) STRING(REGEX REPLACE "^\"([^ ]+) ([^ ]+)\"$" - "\\1" DEAL_II_GIT_REVISION "${_info}") + "\\1" ${_prefix}GIT_REVISION "${_info}") STRING(REGEX REPLACE "^\"([^ ]+) ([^ ]+)\"$" - "\\2" DEAL_II_GIT_SHORTREV "${_info}") + "\\2" ${_prefix}GIT_SHORTREV "${_info}") ENDIF() # @@ -87,7 +106,7 @@ MACRO(DEAL_II_QUERY_GIT_INFORMATION) OUTPUT_STRIP_TRAILING_WHITESPACE ) IF(${_result} EQUAL 0) - STRING(REGEX REPLACE "refs/heads/" "" DEAL_II_GIT_BRANCH "${_branch}") + STRING(REGEX REPLACE "refs/heads/" "" ${_prefix}GIT_BRANCH "${_branch}") ENDIF() ENDIF() diff --git a/doc/news/changes.h b/doc/news/changes.h index 47b6ba62e4..93e08ccb00 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -254,6 +254,13 @@ inconvenience this causes.

Specific improvements

    +
  1. New: A new macro DEAL_II_QUERY_GIT_INFORMATION is + provided to query user projects for git repository information simmilarly + to those exported by deal.II. +
    + (Matthias Maier, 2015/01/21) +
  2. +
  3. Fixed: FEFaceValues and FESubfaceValues did not fill the jacobians and inverse jacobians if requested via the update flags. This is now fixed. -- 2.39.5