]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: record git information in a separate configuration file
authorMatthias Maier <tamiko@43-1.org>
Mon, 3 Jul 2023 16:27:00 +0000 (11:27 -0500)
committerMatthias Maier <tamiko@43-1.org>
Mon, 3 Jul 2023 19:35:05 +0000 (14:35 -0500)
cmake/config/CMakeLists.txt
cmake/config/Config.cmake.in
cmake/config/ConfigGit.cmake.in [new file with mode: 0644]

index f66e2130959423acb4488c463b350cf2800e3d5f..bb0da8f0b66ab968e5c423bf73fec1fc920347c2 100644 (file)
@@ -98,6 +98,11 @@ configure_file(
   ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
   @ONLY
   )
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/ConfigGit.cmake.in
+  ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigGit.cmake
+  @ONLY
+  )
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ConfigVersion.cmake.in
   ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake
@@ -115,6 +120,11 @@ configure_file(
   ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
   @ONLY
   )
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/ConfigGit.cmake.in
+  ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigGit.cmake
+  @ONLY
+  )
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ConfigVersion.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake
@@ -122,6 +132,7 @@ configure_file(
   )
 install(FILES
   ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}Config.cmake
+  ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigGit.cmake
   ${CMAKE_CURRENT_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_NAME}ConfigVersion.cmake
   DESTINATION ${DEAL_II_PROJECT_CONFIG_RELDIR}
   COMPONENT library
index 2c1cc2c3d3ba96f0f7ac4059593092f20bfd6e44..72b2467f01a50776d301a9283d9d966a671cb53d 100644 (file)
@@ -34,11 +34,6 @@ set(DEAL_II_VERSION_MINOR "@DEAL_II_VERSION_MINOR@")
 set(DEAL_II_VERSION_SUBMINOR "@DEAL_II_VERSION_SUBMINOR@")
 set(DEAL_II_VERSION "@DEAL_II_VERSION@")
 
-set(DEAL_II_GIT_BRANCH "@DEAL_II_GIT_BRANCH@")
-set(DEAL_II_GIT_REVISION "@DEAL_II_GIT_REVISION@")
-set(DEAL_II_GIT_SHORTREV "@DEAL_II_GIT_SHORTREV@")
-set(DEAL_II_GIT_TAG "@DEAL_II_GIT_TAG@")
-
 set(DEAL_II_PROJECT_CONFIG_NAME "@DEAL_II_PROJECT_CONFIG_NAME@")
 
 set(DEAL_II_BUILD_TYPE "@CMAKE_BUILD_TYPE@")
@@ -140,9 +135,10 @@ set(DEAL_II_MPIEXEC_PREFLAGS "@MPIEXEC_PREFLAGS@")
 set(DEAL_II_MPIEXEC_POSTFLAGS "@MPIEXEC_POSTFLAGS@")
 
 #
-# Information about library targets and feature configuration
+# Information about git revision, library targets and feature configuration
 #
 
+set(DEAL_II_GIT_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Git.cmake")
 set(DEAL_II_TARGET_CONFIG "${DEAL_II_PATH}/${DEAL_II_PROJECT_CONFIG_RELDIR}/${DEAL_II_PROJECT_CONFIG_NAME}Targets.cmake")
 
 #
diff --git a/cmake/config/ConfigGit.cmake.in b/cmake/config/ConfigGit.cmake.in
new file mode 100644 (file)
index 0000000..c3ba66e
--- /dev/null
@@ -0,0 +1,25 @@
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2023 - 2023 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE.md at
+## the top level directory of deal.II.
+##
+## ---------------------------------------------------------------------
+
+
+#
+# Git information
+#
+
+set(DEAL_II_GIT_BRANCH "@DEAL_II_GIT_BRANCH@")
+set(DEAL_II_GIT_REVISION "@DEAL_II_GIT_REVISION@")
+set(DEAL_II_GIT_SHORTREV "@DEAL_II_GIT_SHORTREV@")
+set(DEAL_II_GIT_TAG "@DEAL_II_GIT_TAG@")
+

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.