]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a revision.h header file that exports git branch and revision for 400/head
authorMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 2 Jan 2015 11:15:02 +0000 (12:15 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Sat, 3 Jan 2015 15:00:13 +0000 (16:00 +0100)
compile time usage in user projects

doc/news/changes.h
include/CMakeLists.txt
include/deal.II/base/revision.h.in [new file with mode: 0644]

index 88d59451c1896baae6b990b46282946da7a21f75..72a17ca31ba6807a54c610c055478dfb4aa6d54f 100644 (file)
@@ -56,6 +56,15 @@ inconvenience this causes.
 
 
 <ol>
+  <li> New: The build system now queries for git branch name and
+  revision sha1 (and automatically reconfigures if necessary). This
+  information is used to annotate summary.log and detailed.log with the
+  current revision sha1. Further, a header file <deal.II/base/revision.h>
+  is now available that exports the macros: DEAL_II_GIT_BRANCH,
+  DEAL_II_GIT_REVISION, DEAL_II_GIT_REVISION_SHORT.
+  <br>
+  (Matthias Maier, 2015/01/02)
+  </li>
 </ol>
 
 
index 88f15474cbdba4c854b2c8308bf65898df4027e1..436e048d7c9a9bcb9c91788c7904ddbb7d3f2110 100644 (file)
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2012 - 2013, 2015 by the deal.II authors
+## Copyright (C) 2012 - 2015 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
 ## ---------------------------------------------------------------------
 
 #
-# Configure config.h
+# Configure config.h and revision.h
 #
 CONFIGURE_FILE(
   ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/base/config.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/deal.II/base/config.h
   )
+CONFIGURE_FILE(
+  ${CMAKE_CURRENT_SOURCE_DIR}/deal.II/base/revision.h.in
+  ${CMAKE_CURRENT_BINARY_DIR}/deal.II/base/revision.h
+  )
 
 #
 # Add a rule for how to install the header files:
diff --git a/include/deal.II/base/revision.h.in b/include/deal.II/base/revision.h.in
new file mode 100644 (file)
index 0000000..72104d8
--- /dev/null
@@ -0,0 +1,34 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2014 - 2015 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 at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+#ifndef __deal2__revision_h
+#define __deal2__revision_h
+
+/**
+ * Name of the local git branch of the source directory.
+ */
+#define DEAL_II_GIT_BRANCH @DEAL_II_GIT_BRANCH@
+
+/**
+ * Full sha1 revision of the current git HEAD.
+ */
+#define DEAL_II_GIT_REVISION @DEAL_II_GIT_REVISION@
+
+/**
+ * Short sha1 revision of the current git HEAD.
+ */
+#define DEAL_II_GIT_SHORTREV @DEAL_II_GIT_SHORTREV@
+
+#endif

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.