Skip to content

Commit

Permalink
Merge pull request #2625 from bilke/buildinfo
Browse files Browse the repository at this point in the history
Split BuildInfo from BaseLib into separate libs
  • Loading branch information
bilke committed Aug 21, 2019
2 parents b8ec383 + 0905b5e commit 0678b2f
Show file tree
Hide file tree
Showing 102 changed files with 423 additions and 414 deletions.
3 changes: 2 additions & 1 deletion Applications/CLI/CMakeLists.txt
@@ -1,6 +1,7 @@
add_executable(ogs ogs.cpp)

target_link_libraries(ogs PRIVATE BaseLib ApplicationsLib)
target_link_libraries(ogs
PRIVATE BaseLib ApplicationsLib CMakeInfoLib GitInfoLib)

if(OGS_USE_PYTHON)
# Troubleshooting: If you get linker errors, such as ogs.cpp:(.text+0xb4):
Expand Down
11 changes: 6 additions & 5 deletions Applications/CLI/ogs.cpp
Expand Up @@ -27,7 +27,6 @@
#endif

// BaseLib
#include "BaseLib/BuildInfo.h"
#include "BaseLib/ConfigTreeUtil.h"
#include "BaseLib/DateTools.h"
#include "BaseLib/FileTools.h"
Expand All @@ -39,6 +38,8 @@
#include "Applications/ApplicationsLib/ProjectData.h"
#include "Applications/ApplicationsLib/TestDefinition.h"
#include "Applications/InSituLib/Adaptor.h"
#include "InfoLib/CMakeInfo.h"
#include "InfoLib/GitInfo.h"
#include "ProcessLib/TimeLoop.h"

#include "NumLib/NumericsConfig.h"
Expand All @@ -58,11 +59,11 @@ int main(int argc, char* argv[])
"See accompanying file LICENSE.txt or "
"http://www.opengeosys.org/project/license\n"
"version: " +
BaseLib::BuildInfo::ogs_version + "\n" +
GitInfoLib::GitInfo::ogs_version + "\n" +
"CMake arguments: " +
BaseLib::BuildInfo::cmake_args,
CMakeInfoLib::CMakeInfo::cmake_args,
' ',
BaseLib::BuildInfo::ogs_version);
GitInfoLib::GitInfo::ogs_version);

TCLAP::ValueArg<std::string> reference_path_arg(
"r", "reference",
Expand Down Expand Up @@ -126,7 +127,7 @@ int main(int argc, char* argv[])
logog_setup.setLevel(log_level_arg.getValue());

INFO("This is OpenGeoSys-6 version %s.",
BaseLib::BuildInfo::ogs_version.c_str());
GitInfoLib::GitInfo::ogs_version.c_str());

#ifndef _WIN32 // On windows this command line option is not present.
// Enable floating point exceptions
Expand Down
1 change: 1 addition & 0 deletions Applications/DataExplorer/DataExplorer.cmake
Expand Up @@ -34,6 +34,7 @@ add_executable(DataExplorer
target_link_libraries(DataExplorer
BaseLib
GeoLib
GitInfoLib
MeshLib
ApplicationsFileIO
DataHolderLib
Expand Down
2 changes: 0 additions & 2 deletions Applications/DataExplorer/VtkVis/VtkVisPipelineItem.h
Expand Up @@ -19,8 +19,6 @@
#include <QString>
#include <QVariant>

#include "BaseLib/BuildInfo.h"

#include "TreeItem.h"

class QStringList;
Expand Down
6 changes: 3 additions & 3 deletions Applications/DataExplorer/main.cpp
Expand Up @@ -15,7 +15,7 @@ FbxScene* lScene = nullptr;

#include <vtkSmartPointer.h>

#include "BaseLib/BuildInfo.h"
#include "InfoLib/GitInfo.h"
#include "BaseLib/LogogSimpleFormatter.h"
#include "VtkVis/VtkConsoleOutputWindow.h"

Expand All @@ -38,14 +38,14 @@ int main(int argc, char* argv[])
QApplication a(argc, argv);
QApplication::setApplicationName("OpenGeoSys - Data Explorer");
QApplication::setApplicationVersion(QString::fromStdString(
BaseLib::BuildInfo::ogs_version));
GitInfoLib::GitInfo::ogs_version));
QApplication::setOrganizationName("OpenGeoSys Community");
QApplication::setOrganizationDomain("opengeosys.org");
setlocale(LC_NUMERIC,"C");
QLocale::setDefault(QLocale::German);
auto w = std::make_unique<MainWindow>();
w->setWindowTitle( w->windowTitle() + " - " +
QString::fromStdString(BaseLib::BuildInfo::ogs_version));
QString::fromStdString(GitInfoLib::GitInfo::ogs_version));
if (QCoreApplication::arguments().size()>1) {
w->loadFileOnStartUp(QCoreApplication::arguments().at(1));
}
Expand Down
6 changes: 3 additions & 3 deletions Applications/DataExplorer/mainwindow.cpp
Expand Up @@ -45,7 +45,7 @@
#include "Applications/FileIO/TetGenInterface.h"
#include "Applications/FileIO/XmlIO/Qt/XmlPrjInterface.h"
#include "Applications/Utils/OGSFileConverter/OGSFileConverter.h"
#include "BaseLib/BuildInfo.h"
#include "InfoLib/GitInfo.h"
#include "BaseLib/FileTools.h"
#include "BaseLib/Histogram.h"
#include "GeoLib/DuplicateGeometry.h"
Expand Down Expand Up @@ -828,10 +828,10 @@ void MainWindow::about()
{
QString about("<a href='https://www.opengeosys.org'>www.opengeosys.org</a><br /><br />");
about.append(QString("Version: %1<br />")
.arg(QString::fromStdString(BaseLib::BuildInfo::ogs_version)));
.arg(QString::fromStdString(GitInfoLib::GitInfo::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)));
.arg(QString::fromStdString(GitInfoLib::GitInfo::git_version_sha1_short)));
about.append(QString("Built date: %1<br />").arg(QDate::currentDate().toString(Qt::ISODate)));

QMessageBox::about(this, "About OpenGeoSys 6", about);
Expand Down
2 changes: 1 addition & 1 deletion Applications/FileIO/CMakeLists.txt
Expand Up @@ -34,7 +34,7 @@ target_link_libraries(ApplicationsFileIO
GeoLib
MathLib
logog
PRIVATE MeshLib)
PRIVATE MeshLib GitInfoLib)

if(OGS_BUILD_GUI)
# Needed for the XmlPrjInterface, which links the DE/Base/OGSError.h.
Expand Down
7 changes: 2 additions & 5 deletions Applications/FileIO/Gmsh/GMSHInterface.cpp
Expand Up @@ -13,7 +13,7 @@

#include <logog/include/logog.hpp>

#include "BaseLib/BuildInfo.h"
#include "InfoLib/GitInfo.h"
#include "BaseLib/FileTools.h"

#include "Applications/FileIO/Gmsh/GMSHInterface.h"
Expand Down Expand Up @@ -74,10 +74,7 @@ GMSHInterface::~GMSHInterface()

bool GMSHInterface::write()
{
_out << "// GMSH input file created by OpenGeoSys " << BaseLib::BuildInfo::ogs_version;
#ifdef BUILD_TIMESTAMP
_out << " built on " << BaseLib::BuildInfo::build_timestamp;
#endif
_out << "// GMSH input file created by OpenGeoSys " << GitInfoLib::GitInfo::ogs_version;
_out << "\n\n";

return writeGMSHInputFile(_out) <= 0;
Expand Down
1 change: 0 additions & 1 deletion Applications/FileIO/XmlIO/Qt/XmlNumInterface.cpp
Expand Up @@ -20,7 +20,6 @@

#include <logog/include/logog.hpp>

#include "BaseLib/BuildInfo.h"
#include "BaseLib/FileFinder.h"


Expand Down
1 change: 0 additions & 1 deletion Applications/FileIO/XmlIO/Qt/XmlPrjInterface.cpp
Expand Up @@ -21,7 +21,6 @@
#include "Applications/DataExplorer/Base/OGSError.h"
#include "Applications/DataHolderLib/FemCondition.h"

#include "BaseLib/BuildInfo.h"
#include "BaseLib/FileFinder.h"
#include "BaseLib/FileTools.h"
#include "BaseLib/IO/Writer.h"
Expand Down
100 changes: 23 additions & 77 deletions Applications/Utils/FileConverter/CMakeLists.txt
@@ -1,84 +1,30 @@
set(TOOLS
convertGEO
generateMatPropsFromMatID
GMSH2OGS
OGS2VTK
VTK2OGS
VTK2TIN
TIN2VTK
TecPlotTools
GocadSGridReader
GocadTSurfaceReader
Mesh2Raster)

if(OGS_BUILD_GUI)
if(Shapelib_FOUND)
add_executable(ConvertSHPToGLI ConvertSHPToGLI.cpp)
set_target_properties(ConvertSHPToGLI PROPERTIES FOLDER Utilities)
target_link_libraries(ConvertSHPToGLI GeoLib Qt5::Xml
${Shapelib_LIBRARIES})
list(APPEND TOOLS ConvertSHPToGLI)
endif()

add_executable(FEFLOW2OGS FEFLOW2OGS.cpp)
set_target_properties(FEFLOW2OGS PROPERTIES FOLDER Utilities)
target_link_libraries(FEFLOW2OGS ApplicationsFileIO)
list(APPEND TOOLS FEFLOW2OGS)
endif()

add_executable(convertGEO convertGEO.cpp)
set_target_properties(convertGEO PROPERTIES FOLDER Utilities)
target_link_libraries(convertGEO GeoLib ApplicationsFileIO)

add_executable(generateMatPropsFromMatID generateMatPropsFromMatID.cpp)
target_link_libraries(generateMatPropsFromMatID MeshLib)
set_target_properties(generateMatPropsFromMatID PROPERTIES FOLDER Utilities)

add_executable(GMSH2OGS GMSH2OGS.cpp)
set_target_properties(GMSH2OGS PROPERTIES FOLDER Utilities)
target_link_libraries(GMSH2OGS ApplicationsFileIO)

add_executable(OGS2VTK OGS2VTK.cpp)
set_target_properties(OGS2VTK PROPERTIES FOLDER Utilities)
target_link_libraries(OGS2VTK MeshLib)

add_executable(VTK2OGS VTK2OGS.cpp)
set_target_properties(VTK2OGS PROPERTIES FOLDER Utilities)
target_link_libraries(VTK2OGS MeshLib)

add_executable(VTK2TIN VTK2TIN.cpp)
set_target_properties(VTK2TIN PROPERTIES FOLDER Utilities)
target_link_libraries(VTK2TIN MeshLib)

add_executable(TIN2VTK TIN2VTK.cpp)
set_target_properties(TIN2VTK PROPERTIES FOLDER Utilities)
target_link_libraries(TIN2VTK MeshLib)

add_executable(TecPlotTools TecPlotTools.cpp)
set_target_properties(TecPlotTools PROPERTIES FOLDER Utilities)
target_link_libraries(TecPlotTools GeoLib MeshLib)
foreach(TOOL ${TOOLS})
add_executable(${TOOL} ${TOOL}.cpp)
target_link_libraries(${TOOL} ApplicationsFileIO GitInfoLib MeshLib)
endforeach()
set_target_properties(${TOOLS} PROPERTIES FOLDER Utilities)
install(TARGETS ${TOOLS} RUNTIME DESTINATION bin COMPONENT Utilities)

add_executable(GocadSGridReader GocadSGridReaderMain.cpp)
set_target_properties(GocadSGridReader PROPERTIES FOLDER Utilities)
target_link_libraries(GocadSGridReader GeoLib MeshLib ApplicationsFileIO)

add_executable(GocadTSurfaceReader GocadTSurfaceReader.cpp)
set_target_properties(GocadTSurfaceReader PROPERTIES FOLDER Utilities)
target_link_libraries(GocadTSurfaceReader MeshLib ApplicationsFileIO)

add_executable(Mesh2Raster MeshToRaster.cpp)
set_target_properties(Mesh2Raster PROPERTIES FOLDER Utilities)
target_link_libraries(Mesh2Raster MeshLib)

# ---- Installation ----
install(TARGETS generateMatPropsFromMatID
GMSH2OGS
OGS2VTK
VTK2OGS
VTK2TIN
TecPlotTools
GocadSGridReader
Mesh2Raster
RUNTIME DESTINATION bin COMPONENT ogs_converter)

if(OGS_BUILD_GUI)
if(Shapelib_FOUND)
install(TARGETS ConvertSHPToGLI
RUNTIME DESTINATION bin COMPONENT ogs_converter)
endif()
install(TARGETS FEFLOW2OGS convertGEO
RUNTIME DESTINATION bin COMPONENT ogs_converter)
if(TARGET ConvertSHPToGLI)
target_link_libraries(ConvertSHPToGLI GeoLib Qt5::Xml ${Shapelib_LIBRARIES})
endif()

cpack_add_component(ogs_converter
DISPLAY_NAME
"File converter"
DESCRIPTION
"File converter."
GROUP
Utilities)
6 changes: 3 additions & 3 deletions Applications/Utils/FileConverter/ConvertSHPToGLI.cpp
Expand Up @@ -22,7 +22,7 @@
#include <shapefil.h>

#include "Applications/ApplicationsLib/LogogSetup.h"
#include "BaseLib/BuildInfo.h"
#include "InfoLib/GitInfo.h"
#include "GeoLib/GEOObjects.h"
#include "GeoLib/IO/XmlIO/Qt/XmlGmlInterface.h"
#include "GeoLib/IO/XmlIO/Qt/XmlStnInterface.h"
Expand Down Expand Up @@ -157,11 +157,11 @@ int main (int argc, char* argv[])
TCLAP::CmdLine cmd(
"Converts points contained in shape file\n\n"
"OpenGeoSys-6 software, version " +
BaseLib::BuildInfo::ogs_version +
GitInfoLib::GitInfo::ogs_version +
".\n"
"Copyright (c) 2012-2019, OpenGeoSys Community "
"(http://www.opengeosys.org)",
' ', BaseLib::BuildInfo::ogs_version);
' ', GitInfoLib::GitInfo::ogs_version);
TCLAP::ValueArg<std::string> shapefile_arg("s",
"shape-file",
"the name of the shape file ",
Expand Down
6 changes: 3 additions & 3 deletions Applications/Utils/FileConverter/FEFLOW2OGS.cpp
Expand Up @@ -16,7 +16,7 @@
#include "Applications/ApplicationsLib/LogogSetup.h"

// BaseLib
#include "BaseLib/BuildInfo.h"
#include "InfoLib/GitInfo.h"
#include "BaseLib/FileTools.h"
#include "BaseLib/RunTime.h"
#ifndef WIN32
Expand All @@ -40,11 +40,11 @@ int main (int argc, char* argv[])
"unstructured grid file (new OGS file format) or to the old OGS file "
"format - see options.\n\n"
"OpenGeoSys-6 software, version " +
BaseLib::BuildInfo::ogs_version +
GitInfoLib::GitInfo::ogs_version +
".\n"
"Copyright (c) 2012-2019, OpenGeoSys Community "
"(http://www.opengeosys.org)",
' ', BaseLib::BuildInfo::ogs_version);
' ', GitInfoLib::GitInfo::ogs_version);

TCLAP::ValueArg<std::string> ogs_mesh_arg(
"o",
Expand Down
6 changes: 3 additions & 3 deletions Applications/Utils/FileConverter/GMSH2OGS.cpp
Expand Up @@ -22,7 +22,7 @@
#include "Applications/ApplicationsLib/LogogSetup.h"

// BaseLib
#include "BaseLib/BuildInfo.h"
#include "InfoLib/GitInfo.h"
#include "BaseLib/FileTools.h"
#include "BaseLib/RunTime.h"
#ifndef WIN32
Expand All @@ -45,11 +45,11 @@ int main (int argc, char* argv[])
"unstructured grid file (new OGS file format) or to the old OGS file "
"format - see options.\n\n"
"OpenGeoSys-6 software, version " +
BaseLib::BuildInfo::ogs_version +
GitInfoLib::GitInfo::ogs_version +
".\n"
"Copyright (c) 2012-2019, OpenGeoSys Community "
"(http://www.opengeosys.org)",
' ', BaseLib::BuildInfo::ogs_version);
' ', GitInfoLib::GitInfo::ogs_version);

TCLAP::ValueArg<std::string> ogs_mesh_arg(
"o",
Expand Down
Expand Up @@ -17,7 +17,7 @@
#include "Applications/ApplicationsLib/LogogSetup.h"
#include "Applications/FileIO/GocadIO/GenerateFaceSetMeshes.h"
#include "Applications/FileIO/GocadIO/GocadSGridReader.h"
#include "BaseLib/BuildInfo.h"
#include "InfoLib/GitInfo.h"
#include "BaseLib/FileTools.h"
#include "MeshLib/Elements/Element.h"
#include "MeshLib/IO/writeMeshToFile.h"
Expand All @@ -35,11 +35,11 @@ int main(int argc, char* argv[])
"https://www.opengeosys.org/docs/tools/meshing/gocadsgridreader/.\n\n "
"OpenGeoSys-6 "
"software, version " +
BaseLib::BuildInfo::ogs_version +
GitInfoLib::GitInfo::ogs_version +
".\n"
"Copyright (c) 2012-2019, OpenGeoSys Community "
"(http://www.opengeosys.org)",
' ', BaseLib::BuildInfo::ogs_version);
' ', GitInfoLib::GitInfo::ogs_version);

TCLAP::ValueArg<bool> face_set_arg(
"f", "generate-face-sets",
Expand Down
6 changes: 3 additions & 3 deletions Applications/Utils/FileConverter/GocadTSurfaceReader.cpp
Expand Up @@ -9,7 +9,7 @@

#include <tclap/CmdLine.h>

#include "BaseLib/BuildInfo.h"
#include "InfoLib/GitInfo.h"
#include "MeshLib/Mesh.h"
#include "MeshLib/IO/VtkIO/VtuInterface.h"
#include "Applications/ApplicationsLib/LogogSetup.h"
Expand All @@ -30,11 +30,11 @@ int main(int argc, char* argv[])
"Reads Gocad ascii files (*.ts, *.pl, *.mx) and writes TSurf- and PLine"
"data into one or more VTU unstructured grids.\n\n"
"OpenGeoSys-6 software, version " +
BaseLib::BuildInfo::ogs_version +
GitInfoLib::GitInfo::ogs_version +
".\n"
"Copyright (c) 2012-2019, OpenGeoSys Community "
"(http://www.opengeosys.org)",
' ', BaseLib::BuildInfo::ogs_version);
' ', GitInfoLib::GitInfo::ogs_version);

TCLAP::ValueArg<std::string> input_arg(
"i", "input-file", "Gocad triangular surfaces file (*.ts)", true, "",
Expand Down

0 comments on commit 0678b2f

Please sign in to comment.