diff --git a/Applications/CLI/ogs.cpp b/Applications/CLI/ogs.cpp index 1b35788142ca575773bf2533d08b1bfe90a5a652..58bf2289204628b22c19f5675dd4d9e34e3c1fd6 100644 --- a/Applications/CLI/ogs.cpp +++ b/Applications/CLI/ogs.cpp @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) "See accompanying file LICENSE.txt or " "http://www.opengeosys.org/project/license", ' ', - BaseLib::BuildInfo::git_version_sha1); + BaseLib::BuildInfo::git_describe); TCLAP::UnlabeledValueArg<std::string> project_arg( "project-file", diff --git a/Applications/DataExplorer/main.cpp b/Applications/DataExplorer/main.cpp index f4c6d16682fb184e75e2af2e303e45763f4ae3c7..88b73df9541bd2c4a4fcbecffb06be4740330912 100644 --- a/Applications/DataExplorer/main.cpp +++ b/Applications/DataExplorer/main.cpp @@ -36,8 +36,7 @@ int main(int argc, char* argv[]) QLocale::setDefault(QLocale::German); MainWindow* w = new MainWindow(); w->setWindowTitle( w->windowTitle() + " - " + - QString::fromStdString(BaseLib::BuildInfo::ogs_version_and_persons) + - " - FirstFloor"); + QString::fromStdString(BaseLib::BuildInfo::git_describe)); w->show(); int returncode = a.exec(); delete w; diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp index 0d0528832bb8a281d060bd5837edc6170f9865b7..d24e173c6a10cc31f4a7f2f0597eac72b79b7caa 100644 --- a/Applications/DataExplorer/mainwindow.cpp +++ b/Applications/DataExplorer/mainwindow.cpp @@ -692,9 +692,9 @@ void MainWindow::showLicense() void MainWindow::about() { QString about("<a href='http://www.opengeosys.org'>http://www.opengeosys.org</a><br /><br />"); - QString ogsVersion = QString::fromStdString( - BaseLib::BuildInfo::ogs_version_and_persons); - about.append(QString("Version: %1<br /><br />").arg(ogsVersion)); + about.append(QString("Version: <a href='https://github.com/ufz/ogs/releases/tag/%2'>%1</a><br /><br />") + .arg(QString::fromStdString(BaseLib::BuildInfo::git_describe)) + .arg(QString::fromStdString(BaseLib::BuildInfo::ogs_version))); about.append(QString("Git commit: <a href='https://github.com/ufz/ogs/commit/%1'>%1</a><br />") .arg(QString::fromStdString(BaseLib::BuildInfo::git_version_sha1_short))); diff --git a/Applications/Utils/FileConverter/TIN2VTK.cpp b/Applications/Utils/FileConverter/TIN2VTK.cpp index 7942a55d02c6d5d63b3918cd18e98bae0fe03b25..a30ea9ad7868b23a75a9256fb4a72cabb3cc75bd 100644 --- a/Applications/Utils/FileConverter/TIN2VTK.cpp +++ b/Applications/Utils/FileConverter/TIN2VTK.cpp @@ -42,7 +42,7 @@ int main (int argc, char* argv[]) BaseLib::LogogSimpleFormatter *custom_format (new BaseLib::LogogSimpleFormatter); logog_cout->SetFormatter(*custom_format); - TCLAP::CmdLine cmd("Converts TIN file into VTU file.", ' ', BaseLib::BuildInfo::git_version_sha1); + TCLAP::CmdLine cmd("Converts TIN file into VTU file.", ' ', BaseLib::BuildInfo::git_describe); TCLAP::ValueArg<std::string> inArg("i", "input-tin-file", "the name of the file containing the input TIN", true, "", "string"); diff --git a/Applications/Utils/FileConverter/VTK2TIN.cpp b/Applications/Utils/FileConverter/VTK2TIN.cpp index a74ffe1b8ec9d86c0839131889df85d42c6508f8..2dbe838b286bca01eb722523f7506f33c389770e 100644 --- a/Applications/Utils/FileConverter/VTK2TIN.cpp +++ b/Applications/Utils/FileConverter/VTK2TIN.cpp @@ -43,7 +43,7 @@ int main (int argc, char* argv[]) BaseLib::LogogSimpleFormatter *custom_format (new BaseLib::LogogSimpleFormatter); logog_cout->SetFormatter(*custom_format); - TCLAP::CmdLine cmd("Converts VTK mesh into TIN file.", ' ', BaseLib::BuildInfo::git_version_sha1); + TCLAP::CmdLine cmd("Converts VTK mesh into TIN file.", ' ', BaseLib::BuildInfo::git_describe); TCLAP::ValueArg<std::string> mesh_in("i", "mesh-input-file", "the name of the file containing the input mesh", true, "", "file name of input mesh"); diff --git a/Applications/Utils/MeshEdit/checkMesh.cpp b/Applications/Utils/MeshEdit/checkMesh.cpp index 623d69ca539ab2952eec4069de8fe91b3ec16fbb..9bea61f02fb2b9161f44960c8aadaf9d0fa87ca9 100644 --- a/Applications/Utils/MeshEdit/checkMesh.cpp +++ b/Applications/Utils/MeshEdit/checkMesh.cpp @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) BaseLib::LogogSimpleFormatter *custom_format (new BaseLib::LogogSimpleFormatter); logog_cout->SetFormatter(*custom_format); - TCLAP::CmdLine cmd("Checks mesh properties", ' ', BaseLib::BuildInfo::git_version_sha1); + TCLAP::CmdLine cmd("Checks mesh properties", ' ', BaseLib::BuildInfo::git_describe); TCLAP::UnlabeledValueArg<std::string> mesh_arg("mesh-file","input mesh file",true,"","string"); cmd.add( mesh_arg ); TCLAP::SwitchArg valid_arg("v","validation","validate the mesh"); diff --git a/Applications/Utils/MeshEdit/reviseMesh.cpp b/Applications/Utils/MeshEdit/reviseMesh.cpp index 7dc04e72d1a9e73fc95a1fedce9fdfe9beb72ac9..3301e96e819f2fbcfaa8ae49fe872796a984ae2d 100644 --- a/Applications/Utils/MeshEdit/reviseMesh.cpp +++ b/Applications/Utils/MeshEdit/reviseMesh.cpp @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) BaseLib::LogogSimpleFormatter *custom_format (new BaseLib::LogogSimpleFormatter); logog_cout->SetFormatter(*custom_format); - TCLAP::CmdLine cmd("Mesh revision tool", ' ', BaseLib::BuildInfo::git_version_sha1); + TCLAP::CmdLine cmd("Mesh revision tool", ' ', BaseLib::BuildInfo::git_describe); TCLAP::ValueArg<std::string> input_arg("i", "input-mesh-file","input mesh file",true,"","string"); cmd.add( input_arg ); TCLAP::ValueArg<std::string> output_arg("o", "output-mesh-file","output mesh file",true,"","string"); diff --git a/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp b/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp index 7adb50c64cd2587d95356c5328d646d0da8c023d..1a285df599f02e85fe5ea643b121aeaa1f679ef4 100644 --- a/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp +++ b/Applications/Utils/SimpleMeshCreation/generateStructuredMesh.cpp @@ -76,7 +76,7 @@ int main (int argc, char* argv[]) "See accompanying file LICENSE.txt or " "http://www.opengeosys.org/project/license", ' ', - BaseLib::BuildInfo::git_version_sha1); + BaseLib::BuildInfo::git_describe); std::unique_ptr<BaseLib::TCLAPCustomOutput> tclapOutput(new BaseLib::TCLAPCustomOutput()); cmd.setOutput(tclapOutput.get()); diff --git a/BaseLib/BuildInfo.cpp.in b/BaseLib/BuildInfo.cpp.in index 2715eb783aa0d5cd863339dc6480f360fc1a63f0..4e6a624a38c812d5ae17f32c436e8f1ab9281ced 100644 --- a/BaseLib/BuildInfo.cpp.in +++ b/BaseLib/BuildInfo.cpp.in @@ -27,8 +27,8 @@ namespace BuildInfo const std::string git_version_sha1("@GIT_SHA1@"); const std::string git_version_sha1_short("@GIT_SHA1_SHORT@"); + const std::string git_describe("@GIT_DESCRIBE@"); const std::string ogs_version("@OGS_VERSION@"); - const std::string ogs_version_and_persons("@OGS_VERSION_AND_PERSONS@"); const std::string source_path("@CMAKE_CURRENT_SOURCE_DIR@"); const std::string tests_tmp_path("@PROJECT_BINARY_DIR@/Tests/"); diff --git a/BaseLib/BuildInfo.h b/BaseLib/BuildInfo.h index bd398c2841885543f2d7d1d482337be1b16b3ee9..00bb4637e03ac77096226fac9c863eefb975098d 100644 --- a/BaseLib/BuildInfo.h +++ b/BaseLib/BuildInfo.h @@ -29,8 +29,8 @@ namespace BuildInfo extern const std::string git_version_sha1; extern const std::string git_version_sha1_short; + extern const std::string git_describe; extern const std::string ogs_version; - extern const std::string ogs_version_and_persons; extern const std::string source_path; extern const std::string tests_tmp_path; diff --git a/CMakeLists.txt b/CMakeLists.txt index 06049bc26f81090eeb32a7804c21fe6cf9cb6ee6..48539dc9a6b8df9db530df759b3bc1106752c888 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,19 +14,6 @@ ENDIF() # Project name PROJECT( OGS-6 ) -########################################################################### -### OGS version information. Adjust these if you release a new version. ### -########################################################################### -SET (OGS_VERSION_MAJOR 6) -SET (OGS_VERSION_MINOR 0) -SET (OGS_VERSION_PATCH 0) -SET (OSG_VERSION_STATUS "Beta") # Can be words like Alpha, Beta, Prerelease or "" -SET (OGS_RELEASE_PERSONS "Core developers") -SET (OGS_VERSION "${OGS_VERSION_MAJOR}.${OGS_VERSION_MINOR}.${OGS_VERSION_PATCH}") -SET (OGS_VERSION_AND_PERSONS "${OGS_VERSION} ${OSG_VERSION_STATUS} (${OGS_RELEASE_PERSONS})") -SET (OGS_DATE "2012-08-20") - - ########################### ### Preliminary Options ### ########################### diff --git a/FileIO/GMSHInterface.cpp b/FileIO/GMSHInterface.cpp index 988a6ada6567d529751ba04e4f1ffb274e34c42f..82546573aa638cbf8f809f59e52bcdb92e493313 100644 --- a/FileIO/GMSHInterface.cpp +++ b/FileIO/GMSHInterface.cpp @@ -200,7 +200,7 @@ void GMSHInterface::readNodeIDs(std::ifstream &in, } MeshLib::Element* GMSHInterface::readElement(std::ifstream &in, std::vector<MeshLib::Node*> const& nodes, std::map<unsigned, unsigned> const& id_map) -{ +{ unsigned idx, type, n_tags, dummy, mat_id; std::vector<unsigned> node_ids; std::vector<MeshLib::Node*> elem_nodes; @@ -275,7 +275,7 @@ MeshLib::Element* GMSHInterface::readElement(std::ifstream &in, std::vector<Mesh bool GMSHInterface::write() { - _out << "// GMSH input file created by OpenGeoSys " << BaseLib::BuildInfo::ogs_version_and_persons; + _out << "// GMSH input file created by OpenGeoSys " << BaseLib::BuildInfo::git_describe; #ifdef BUILD_TIMESTAMP _out << " built on " << BaseLib::BuildInfo::build_timestamp; #endif diff --git a/scripts/cmake/CMakeSetup.cmake b/scripts/cmake/CMakeSetup.cmake index 3704b5143ca4900f59d2527dfda6fb3115f0a7a7..37c5ecee67210e06b2bb7bf5c7d7571c5f3ef729 100644 --- a/scripts/cmake/CMakeSetup.cmake +++ b/scripts/cmake/CMakeSetup.cmake @@ -17,6 +17,19 @@ SET(NUM_PROCESSORS ${NUM_PROCESSORS} CACHE STRING "Processor count") INCLUDE(GetGitRevisionDescription) GET_GIT_HEAD_REVISION(GIT_REFSPEC GIT_SHA1) STRING(SUBSTRING ${GIT_SHA1} 0 8 GIT_SHA1_SHORT) +GIT_GET_TAG(GIT_DESCRIBE) + +STRING(REGEX MATCH ^[0-9|\\.]* GIT_TAG ${GIT_DESCRIBE}) +SET(OGS_VERSION ${GIT_TAG}) +IF(GIT_DESCRIBE MATCHES ".*-.*-.*") + # Commit is not a tag + SET(OGS_IS_RELEASE FALSE) + STRING(REGEX MATCH "-([0-9]+)-" GIT_COMMITS_AFTER_TAG ${GIT_DESCRIBE}) +ELSE() + SET(OGS_VERSION_STATUS "") + SET(OGS_IS_RELEASE TRUE) + MESSAGE(STATUS "OGS version: ${OGS_VERSION}") +ENDIF() # Get the hostname SITE_NAME(HOSTNAME) diff --git a/scripts/cmake/cmake/GetGitRevisionDescription.cmake b/scripts/cmake/cmake/GetGitRevisionDescription.cmake index c8d27f2e8ce494c96404086ce58982239916a44c..4da5f1d7f10457aa9dc51101c9d2a03acabb4d72 100644 --- a/scripts/cmake/cmake/GetGitRevisionDescription.cmake +++ b/scripts/cmake/cmake/GetGitRevisionDescription.cmake @@ -128,3 +128,8 @@ function(git_get_exact_tag _var) git_describe(out --exact-match ${ARGN}) set(${_var} "${out}" PARENT_SCOPE) endfunction() + +function(git_get_tag _var) + git_describe(out --tags ${ARGN}) + set(${_var} "${out}" PARENT_SCOPE) +endfunction() diff --git a/scripts/cmake/packaging/Pack.cmake b/scripts/cmake/packaging/Pack.cmake index 96256c584a0dc72f68ef06d3f877fbd218a7da69..3b4cff42914f739eaa64c99810f8488e2ab2b131 100644 --- a/scripts/cmake/packaging/Pack.cmake +++ b/scripts/cmake/packaging/Pack.cmake @@ -12,10 +12,10 @@ SET(CPACK_PACKAGE_VERSION_MAJOR "${OGS_VERSION_MAJOR}") SET(CPACK_PACKAGE_VERSION_MINOR "${OGS_VERSION_MINOR}") SET(CPACK_PACKAGE_VERSION_PATCH "${OGS_VERSION_PATCH}") IF(APPLE) - SET(CPACK_PACKAGE_FILE_NAME "ogs-${OGS_VERSION}-OSX-${OSX_VERSION}-x${BITS}") + SET(CPACK_PACKAGE_FILE_NAME "ogs-${GIT_DESCRIBE}-OSX-${OSX_VERSION}-x${BITS}") SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) ELSE() - SET(CPACK_PACKAGE_FILE_NAME "ogs-${OGS_VERSION}-${CMAKE_SYSTEM}-x${BITS}") + SET(CPACK_PACKAGE_FILE_NAME "ogs-${GIT_DESCRIBE}-${CMAKE_SYSTEM}-x${BITS}") ENDIF() #SET(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)