From ffca2c44e5e775567c3170b01c48d7185599182f Mon Sep 17 00:00:00 2001
From: Tobias Meisel <tobias.meisel@ufz.de>
Date: Mon, 23 Nov 2020 12:28:21 +0100
Subject: [PATCH] [MeL/IO] Xdmf contains OGS_VERSION

---
 InfoLib/GitInfo.cpp.in              | 1 +
 InfoLib/GitInfo.h                   | 1 +
 MeshLib/CMakeLists.txt              | 2 +-
 ProcessLib/Output/ProcessOutput.cpp | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/InfoLib/GitInfo.cpp.in b/InfoLib/GitInfo.cpp.in
index aed88299924..bb8568d9b22 100644
--- a/InfoLib/GitInfo.cpp.in
+++ b/InfoLib/GitInfo.cpp.in
@@ -17,6 +17,7 @@ namespace GitInfoLib
 
 namespace GitInfo
 {
+    const std::string OGS_VERSION = "OGS_VERSION";
     const std::string git_version_sha1_short("@GIT_SHA1_SHORT@");
     const std::string ogs_version("@OGS_VERSION@");
 }
diff --git a/InfoLib/GitInfo.h b/InfoLib/GitInfo.h
index a8f1f2a6402..ddd35700cbf 100644
--- a/InfoLib/GitInfo.h
+++ b/InfoLib/GitInfo.h
@@ -21,6 +21,7 @@ namespace GitInfoLib
 
 namespace GitInfo
 {
+    extern GITINFOLIB_EXPORT std::string const OGS_VERSION;
     extern GITINFOLIB_EXPORT const std::string git_version_sha1_short;
     extern GITINFOLIB_EXPORT const std::string ogs_version;
 }  // namespace
diff --git a/MeshLib/CMakeLists.txt b/MeshLib/CMakeLists.txt
index da1d83bc773..113ae2e7326 100644
--- a/MeshLib/CMakeLists.txt
+++ b/MeshLib/CMakeLists.txt
@@ -26,7 +26,7 @@ ogs_add_library(MeshLib ${SOURCES})
 
 target_link_libraries(
     MeshLib
-    PUBLIC BaseLib GeoLib MathLib ${VTK_LIBRARIES}
+    PUBLIC BaseLib GeoLib GitInfoLib MathLib ${VTK_LIBRARIES}
     PRIVATE spdlog::spdlog)
 
 if(OGS_USE_MPI AND TARGET MPI::MPI_CXX)
diff --git a/ProcessLib/Output/ProcessOutput.cpp b/ProcessLib/Output/ProcessOutput.cpp
index 85de2aab04c..7cde482d1c0 100644
--- a/ProcessLib/Output/ProcessOutput.cpp
+++ b/ProcessLib/Output/ProcessOutput.cpp
@@ -27,7 +27,7 @@
 static void addOgsVersion(MeshLib::Mesh& mesh)
 {
     auto& ogs_version_field = *MeshLib::getOrCreateMeshProperty<char>(
-        mesh, "OGS_VERSION", MeshLib::MeshItemType::IntegrationPoint, 1);
+        mesh, GitInfoLib::GitInfo::OGS_VERSION, MeshLib::MeshItemType::IntegrationPoint, 1);
 
     ogs_version_field.assign(GitInfoLib::GitInfo::ogs_version.begin(),
                              GitInfoLib::GitInfo::ogs_version.end());
-- 
GitLab