diff --git a/InfoLib/GitInfo.cpp.in b/InfoLib/GitInfo.cpp.in index aed88299924a2a4a9d67fb53a8f13003496d87f3..bb8568d9b22cea49eacdab46606d54f6bbbc365f 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 a8f1f2a64029720c1ba204152958723d63dff44a..ddd35700cbffa4055caaf5ba8ed6899efbf39ec9 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 da1d83bc77338536ff48aa11a59030dfe54502d6..113ae2e732614af6e7126816e5067adae384e1d0 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 85de2aab04cbaf44069c89b622bad5f256484090..7cde482d1c070e154eecc77fe5ed399b44a966a9 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());