diff --git a/.travis.yml b/.travis.yml index 9608838164466cfda44313c7179aabc6fc0a96d1..344348bc39b7841f0141302bf701cc0e272112d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,8 @@ addons: - ubuntu-toolchain-r-test packages: - g++-4.8 - - qt4-dev-tools + - qtbase5-dev + - libqt5xmlpatterns5-dev - libxt-dev - libshp-dev diff --git a/Applications/CLI/CMakeLists.txt b/Applications/CLI/CMakeLists.txt index 2c7aafaac8327a4100d02d665e8fd9e69099533d..4f65bdb9446af4278f63c21e827769ca80b1e403 100644 --- a/Applications/CLI/CMakeLists.txt +++ b/Applications/CLI/CMakeLists.txt @@ -33,6 +33,3 @@ cpack_add_component(ogs_cli DESCRIPTION "The command line interface for OpenGeoSys." GROUP Applications ) - -include(packaging/InstallDependencies) -InstallDependencies(ogs) diff --git a/Applications/DataExplorer/Base/CMakeLists.txt b/Applications/DataExplorer/Base/CMakeLists.txt index 9be3da3231e2d41d55c15f85b54122a9e26d5c45..8c5ce146dfa56644a2d67021980c4616d0d2018a 100644 --- a/Applications/DataExplorer/Base/CMakeLists.txt +++ b/Applications/DataExplorer/Base/CMakeLists.txt @@ -37,7 +37,7 @@ add_library(QtBase ) target_link_libraries(QtBase - Qt4::QtGui + Qt5::Widgets GeoLib) set_property(TARGET QtBase PROPERTY FOLDER "DataExplorer") diff --git a/Applications/DataExplorer/Base/modeltest.cpp b/Applications/DataExplorer/Base/modeltest.cpp index 0501b9dfeb286cf9f1be5f7ce99acfa489797740..261b85199f4e5a8fd771b450762fe985b38d6a09 100644 --- a/Applications/DataExplorer/Base/modeltest.cpp +++ b/Applications/DataExplorer/Base/modeltest.cpp @@ -401,23 +401,23 @@ void ModelTest::data() // General Purpose roles that should return a QString QVariant variant = model->data(model->index(0, 0), Qt::ToolTipRole); if (variant.isValid()) - Q_ASSERT(qVariantCanConvert<QString>(variant)); + Q_ASSERT(variant.canConvert(QMetaType::QString))); variant = model->data(model->index(0, 0), Qt::StatusTipRole); if (variant.isValid()) - Q_ASSERT(qVariantCanConvert<QString>(variant)); + Q_ASSERT(variant.canConvert(QMetaType::QString))); variant = model->data(model->index(0, 0), Qt::WhatsThisRole); if (variant.isValid()) - Q_ASSERT(qVariantCanConvert<QString>(variant)); + Q_ASSERT(variant.canConvert(QMetaType::QString))); // General Purpose roles that should return a QSize variant = model->data(model->index(0, 0), Qt::SizeHintRole); if (variant.isValid()) - Q_ASSERT(qVariantCanConvert<QSize>(variant)); + Q_ASSERT(variant.canConvert(QMetaType::QString))); // General Purpose roles that should return a QFont QVariant fontVariant = model->data(model->index(0, 0), Qt::FontRole); if (fontVariant.isValid()) - Q_ASSERT(qVariantCanConvert<QFont>(fontVariant)); + Q_ASSERT(fontVariant.canConvert(QMetaType::QFont))); // Check that the alignment is one we know about QVariant textAlignmentVariant = model->data(model->index(0, 0), Qt::TextAlignmentRole); @@ -440,11 +440,11 @@ void ModelTest::data() // General Purpose roles that should return a QColor QVariant colorVariant = model->data(model->index(0, 0), Qt::BackgroundColorRole); if (colorVariant.isValid()) - Q_ASSERT(qVariantCanConvert<QColor>(colorVariant)); + Q_ASSERT(colorVariant.canConvert(QMetaType::QColor))); colorVariant = model->data(model->index(0, 0), Qt::TextColorRole); if (colorVariant.isValid()) - Q_ASSERT(qVariantCanConvert<QColor>(colorVariant)); + Q_ASSERT(colorVariant.canConvert(QMetaType::QColor))); // Check that the "check state" is one we know about. QVariant checkStateVariant = model->data(model->index(0, 0), Qt::CheckStateRole); @@ -539,4 +539,3 @@ void ModelTest::rowsRemoved(const QModelIndex & parent, int start, int end) Q_ASSERT(c.last == model->data(model->index(start - 1, 0, c.parent))); Q_ASSERT(c.next == model->data(model->index(start, 0, c.parent))); } - diff --git a/Applications/DataExplorer/DataExplorer.cmake b/Applications/DataExplorer/DataExplorer.cmake index e477eea9e31900484595959cc0f9c53dee7abc96..71b12b747c418cfb490772474de8f79d47463601 100644 --- a/Applications/DataExplorer/DataExplorer.cmake +++ b/Applications/DataExplorer/DataExplorer.cmake @@ -40,7 +40,7 @@ source_group("UI Files" FILES ${UIS}) set(APP_ICON ${SOURCE_DIR_REL}/scripts/packaging/ogs-de-icon.icns) # Create the executable -add_executable(DataExplorer MACOSX_BUNDLE +add_executable(DataExplorer main.cpp ${SOURCES} ${UIS} @@ -49,10 +49,10 @@ add_executable(DataExplorer MACOSX_BUNDLE ) target_link_libraries(DataExplorer - Qt4::QtCore - Qt4::QtGui - Qt4::QtXml - Qt4::QtNetwork + Qt5::Core + Qt5::Gui + Qt5::Xml + Qt5::Network ApplicationsLib ApplicationsFileIO DataHolderLib @@ -67,6 +67,12 @@ target_link_libraries(DataExplorer logog ) +# Workaround for Windows conan tiff-package +if(USE_CONAN AND WIN32) + find_package(ZLIB REQUIRED) + target_link_libraries(DataExplorer ${ZLIB_LIBRARIES}) +endif() + if(CMAKE_CROSSCOMPILING) target_link_libraries(DataExplorer ${QT_XML_DEPS_LIBRARIES} @@ -103,18 +109,7 @@ set_property(TARGET DataExplorer PROPERTY FOLDER "DataExplorer") #################### ### Installation ### #################### -if(APPLE) - include(packaging/PackagingMacros) - ConfigureMacOSXBundle(DataExplorer ${APP_ICON}) - - install(TARGETS DataExplorer DESTINATION .) - set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .) - include(InstallRequiredSystemLibraries) - include(DeployQt4) - INSTALL_QT4_EXECUTABLE(DataExplorer.app "" "" "${CONAN_LIB_DIRS}" "" "" ogs_gui) -else() - install(TARGETS DataExplorer RUNTIME DESTINATION bin COMPONENT ogs_gui) -endif() +install(TARGETS DataExplorer RUNTIME DESTINATION bin COMPONENT ogs_gui) cpack_add_component(ogs_gui DISPLAY_NAME "OGS Data Explorer" @@ -123,9 +118,3 @@ cpack_add_component(ogs_gui ) set(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "DataExplorer" "OGS Data Explorer" PARENT_SCOPE) set(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "bin/DataExplorer.exe" "Data Explorer" PARENT_SCOPE) -if(APPLE) - return() -endif() - -include(packaging/InstallDependencies) -InstallDependencies(DataExplorer) diff --git a/Applications/DataExplorer/DataView/CMakeLists.txt b/Applications/DataExplorer/DataView/CMakeLists.txt index 744b1c9f4902d75e0d8b7abc28556a3e1c82d9dd..5bf3d1281baa5437530ff55881b1c07234d38f41 100644 --- a/Applications/DataExplorer/DataView/CMakeLists.txt +++ b/Applications/DataExplorer/DataView/CMakeLists.txt @@ -127,7 +127,7 @@ add_library(QtDataView ${UIS} ) -target_link_libraries(QtDataView Qt4::QtCore Qt4::QtGui) +target_link_libraries(QtDataView Qt5::Core Qt5::Gui) target_link_libraries(QtDataView ApplicationsFileIO DataHolderLib diff --git a/Applications/DataExplorer/DataView/ColorTableView.cpp b/Applications/DataExplorer/DataView/ColorTableView.cpp index ab20d4774a782f3c1d6fb68aed93e310667dcae6..805d870f915c868dad3dd1c238938dde00c61caa 100644 --- a/Applications/DataExplorer/DataView/ColorTableView.cpp +++ b/Applications/DataExplorer/DataView/ColorTableView.cpp @@ -32,9 +32,9 @@ void ColorTableViewDelegate::paint(QPainter* painter, QColor val; if (index.column() == 1) { - if (qVariantCanConvert<QColor>(index.data())) + if (index.data().canConvert(QMetaType::QColor)) { - val = qVariantValue<QColor>(index.data()); + val = index.data().value<QColor>(); QBrush brush(val); painter->fillRect(option.rect, brush); } @@ -51,4 +51,3 @@ QSize ColorTableViewDelegate::sizeHint( const QStyleOptionViewItem &option, s.setHeight((int)(0.5 * s.height())); return s; } - diff --git a/Applications/DataExplorer/DataView/DiagramView/CMakeLists.txt b/Applications/DataExplorer/DataView/DiagramView/CMakeLists.txt index 5fe4562e3005ed017ac76f3566880b22fcbc4d2d..4c42911159f7d5f9c32c53d2aa77b789ee1a7b85 100644 --- a/Applications/DataExplorer/DataView/DiagramView/CMakeLists.txt +++ b/Applications/DataExplorer/DataView/DiagramView/CMakeLists.txt @@ -41,7 +41,7 @@ add_library(QtDiagramView ) target_link_libraries(QtDiagramView - Qt4::QtGui + Qt5::Gui GeoLib QtBase ) diff --git a/Applications/DataExplorer/DataView/DiagramView/DetailWindow.h b/Applications/DataExplorer/DataView/DiagramView/DetailWindow.h index e4a0f209a9ffd14fe1f81515886d4f54a821fb54..b473773748858d1e4a24f986b90ae276f9010edc 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DetailWindow.h +++ b/Applications/DataExplorer/DataView/DiagramView/DetailWindow.h @@ -16,7 +16,8 @@ #define DETAILWINDOW_H #include "ui_DetailWindow.h" -#include <QtGui/QWidget> +#include <QWidget> + /** * \brief Creates a window containing a diagram. diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.h b/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.h index 7f15039f78bf9618179ec50c4e149c2e36db2d8a..cc8c4804fab25cd6423cee3e57383bea941da5ae 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.h +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.h @@ -16,7 +16,8 @@ #define DIAGRAMPREFSDIALOG_H #include "ui_DiagramPrefs.h" -#include <QtGui/QMainWindow> +#include <QMainWindow> + class DetailWindow; class DiagramList; diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramScene.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramScene.cpp index f807a508adb35a8c7b6d887ac483e695855d54f2..1ca78e01c0786cae9579fec47e665dbd9672ad51 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramScene.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramScene.cpp @@ -288,7 +288,7 @@ void DiagramScene::initialize() setYAxis(addArrow(_bounds.height(), -90, pen)); _xLabel = addNonScalableText(" "); _yLabel = addNonScalableText(" "); - _yLabel->rotate(-90); + _yLabel->setRotation(-90); _xUnit = addNonScalableText(" "); _yUnit = addNonScalableText(" "); diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramView.h b/Applications/DataExplorer/DataView/DiagramView/DiagramView.h index 6cd385ca78cd8de039cc01bbcafca76c33ab2bf5..7b3412b1af4a571a333d2a9eae0354fd95adba76 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramView.h +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramView.h @@ -17,7 +17,8 @@ #include "DiagramScene.h" #include <QGraphicsView> -#include <QtGui/QWidget> +#include <QWidget> + /** * \brief A view in which to display a DiagramScene. diff --git a/Applications/DataExplorer/DataView/ElementTreeModel.cpp b/Applications/DataExplorer/DataView/ElementTreeModel.cpp index c6ee22c0257202a0b518d92965b306f1eebf9c45..4594364b1f1d23e2bcf18f5ee41489b16a1a526d 100644 --- a/Applications/DataExplorer/DataView/ElementTreeModel.cpp +++ b/Applications/DataExplorer/DataView/ElementTreeModel.cpp @@ -43,6 +43,8 @@ ElementTreeModel::~ElementTreeModel() void ElementTreeModel::setElement(vtkUnstructuredGridAlgorithm const*const grid, const unsigned elem_index) { + beginResetModel(); + _mesh_source = grid; this->clearView(); @@ -95,17 +97,20 @@ void ElementTreeModel::setElement(vtkUnstructuredGridAlgorithm const*const grid, TreeItem* nodeItem = new TreeItem(nodeData, nodeListItem); nodeListItem->appendChild(nodeItem); } - reset(); + endResetModel(); } void ElementTreeModel::clearView() { + beginResetModel(); _rootItem->removeChildren(0, _rootItem->childCount()); - reset(); + endResetModel(); } void ElementTreeModel::setMesh(MeshLib::Mesh const& mesh) { + beginResetModel(); + this->clearView(); QList<QVariant> mesh_name; @@ -180,7 +185,5 @@ void ElementTreeModel::setMesh(MeshLib::Mesh const& mesh) _rootItem->appendChild(vec_item); } - reset(); - + endResetModel(); } - diff --git a/Applications/DataExplorer/DataView/GeoTreeModel.cpp b/Applications/DataExplorer/DataView/GeoTreeModel.cpp index 8f93ca384a27d9016d3b9a6a0a9ca4e57fbb8d32..0c2a4b42d2faea14608f30e53b636fbbd614a01a 100644 --- a/Applications/DataExplorer/DataView/GeoTreeModel.cpp +++ b/Applications/DataExplorer/DataView/GeoTreeModel.cpp @@ -39,6 +39,8 @@ GeoTreeModel::~GeoTreeModel() void GeoTreeModel::addPointList(QString geoName, GeoLib::PointVec const& pointVec) { + beginResetModel(); + const std::vector<GeoLib::Point*>* points = pointVec.getVector(); QList<QVariant> geoData; @@ -74,11 +76,13 @@ void GeoTreeModel::addPointList(QString geoName, GeoLib::PointVec const& pointVe INFO("Geometry \"%s\" built. %d points added.", geoName.toStdString().c_str(), nPoints); - reset(); + endResetModel(); } void GeoTreeModel::addPolylineList(QString geoName, GeoLib::PolylineVec const& polylineVec) { + beginResetModel(); + int nLists = _rootItem->childCount(); TreeItem* geo(NULL); for (int i = 0; i < nLists; i++) @@ -100,7 +104,8 @@ void GeoTreeModel::addPolylineList(QString geoName, GeoLib::PolylineVec const& p GeoObjectListItem* plyList = new GeoObjectListItem(plyData, geo, lines, GeoLib::GEOTYPE::POLYLINE); geo->appendChild(plyList); this->addChildren(plyList, polylineVec, 0, lines->size()); - reset(); + + endResetModel(); } void GeoTreeModel::appendPolylines(const std::string &name, GeoLib::PolylineVec const& polylineVec) @@ -114,10 +119,11 @@ void GeoTreeModel::appendPolylines(const std::string &name, GeoLib::PolylineVec static_cast<GeoObjectListItem*>(_lists[i]->child(j)); if (GeoLib::GEOTYPE::POLYLINE == parent->getType()) { + beginResetModel(); this->addChildren(parent, polylineVec, parent->childCount(), polylineVec.getVector()->size()); - reset(); + endResetModel(); parent->vtkSource()->Modified(); return; } @@ -166,6 +172,8 @@ void GeoTreeModel::addChildren(GeoObjectListItem* plyList, void GeoTreeModel::addSurfaceList(QString geoName, GeoLib::SurfaceVec const& surfaceVec) { + beginResetModel(); + int nLists = _rootItem->childCount(); TreeItem* geo(NULL); for (int i = 0; i < nLists; i++) @@ -188,7 +196,7 @@ void GeoTreeModel::addSurfaceList(QString geoName, GeoLib::SurfaceVec const& sur geo->appendChild(sfcList); this->addChildren(sfcList, surfaceVec, 0, surfaces->size()); - reset(); + endResetModel(); } void GeoTreeModel::appendSurfaces(const std::string &name, GeoLib::SurfaceVec const& surfaceVec) @@ -204,11 +212,12 @@ void GeoTreeModel::appendSurfaces(const std::string &name, GeoLib::SurfaceVec co static_cast<GeoObjectListItem*>(_lists[i]->child(j)); if (GeoLib::GEOTYPE::SURFACE == parent->getType()) { + beginResetModel(); this->addChildren(parent, surfaceVec, parent->childCount(), surfaceVec.getVector()->size()); parent->vtkSource()->Modified(); - reset(); + endResetModel(); return; } } diff --git a/Applications/DataExplorer/DataView/MshModel.cpp b/Applications/DataExplorer/DataView/MshModel.cpp index 224c8adf5427b5d84cf72a09d677e7713afc3bd4..8c32762e268ac34adfd7a737fba1bdd0ff7df61b 100644 --- a/Applications/DataExplorer/DataView/MshModel.cpp +++ b/Applications/DataExplorer/DataView/MshModel.cpp @@ -65,6 +65,8 @@ void MshModel::addMesh(MeshLib::Mesh* mesh) void MshModel::addMeshObject(const MeshLib::Mesh* mesh) { + beginResetModel(); + INFO("name: %s", mesh->getName().c_str()); QVariant const display_name (QString::fromStdString(mesh->getName())); QList<QVariant> meshData; @@ -84,7 +86,7 @@ void MshModel::addMeshObject(const MeshLib::Mesh* mesh) newMesh->appendChild(new TreeItem(elemData, newMesh)); } - reset(); + endResetModel(); emit meshAdded(this, this->index(_rootItem->childCount() - 1, 0, QModelIndex())); } @@ -134,9 +136,10 @@ bool MshModel::removeMesh(const std::string &name) TreeItem* item = _rootItem->child(i); if (item->data(0).toString().toStdString().compare(name) == 0) { + beginResetModel(); emit meshRemoved(this, this->index(i, 0, QModelIndex())); _rootItem->removeChildren(i,1); - reset(); + endResetModel(); return _project.removeMesh(name); } } @@ -201,4 +204,3 @@ vtkUnstructuredGridAlgorithm* MshModel::vtkSource(const std::string &name) const INFO("MshModel::vtkSource(): No entry found with name \"%s\".", name.c_str()); return nullptr; } - diff --git a/Applications/DataExplorer/DataView/StationTreeModel.cpp b/Applications/DataExplorer/DataView/StationTreeModel.cpp index 0dc9b0193df7fff517998f14cec84b81db3cfc18..1f413d956971a88d85513a87b36fff4eba7cffec 100644 --- a/Applications/DataExplorer/DataView/StationTreeModel.cpp +++ b/Applications/DataExplorer/DataView/StationTreeModel.cpp @@ -123,6 +123,8 @@ void StationTreeModel::setNameForItem(const std::string& stn_vec_name, */ void StationTreeModel::addStationList(QString listName, const std::vector<GeoLib::Point*>* stations) { + beginResetModel(); + QList<QVariant> grpName; if (listName.compare("") == 0) // if no name is given a default name is assigned { @@ -150,7 +152,7 @@ void StationTreeModel::addStationList(QString listName, const std::vector<GeoLib qDebug() << "List" << listName << "loaded, " << stations->size() << "items added."; - reset(); + endResetModel(); } /** @@ -181,4 +183,3 @@ void StationTreeModel::removeStationList(const std::string &name) if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) removeStationList(createIndex(_lists[i]->row(), 0, _lists[i])); } - diff --git a/Applications/DataExplorer/DataView/StratView/CMakeLists.txt b/Applications/DataExplorer/DataView/StratView/CMakeLists.txt index 4a98b67959554a7f8ffaa8a3723c7250abbfe1b1..409dce76c930fc59e3be767b3fab4cd48019e0ef 100644 --- a/Applications/DataExplorer/DataView/StratView/CMakeLists.txt +++ b/Applications/DataExplorer/DataView/StratView/CMakeLists.txt @@ -32,6 +32,6 @@ add_library(QtStratView ${UIS} ) -target_link_libraries(QtStratView Qt4::QtGui QtBase) +target_link_libraries(QtStratView Qt5::Gui QtBase) set_property(TARGET QtStratView PROPERTY FOLDER "DataExplorer") diff --git a/Applications/DataExplorer/DataView/StratView/StratView.h b/Applications/DataExplorer/DataView/StratView/StratView.h index f54d5f01bfc41578d59868978b29cc21bc18d7f1..88771d54b1a7ff5649e0eaa9588a3378456fc083 100644 --- a/Applications/DataExplorer/DataView/StratView/StratView.h +++ b/Applications/DataExplorer/DataView/StratView/StratView.h @@ -17,7 +17,8 @@ #include "StratScene.h" #include <QGraphicsView> -#include <QtGui/QWidget> +#include <QWidget> + namespace GeoLib { diff --git a/Applications/DataExplorer/VtkAct/CMakeLists.txt b/Applications/DataExplorer/VtkAct/CMakeLists.txt index 0868f2ac068e82b8f1ef5889acaa90c7f64eaca7..2c22239592e3aafda6b44d5d9c99eac6e4a822c4 100644 --- a/Applications/DataExplorer/VtkAct/CMakeLists.txt +++ b/Applications/DataExplorer/VtkAct/CMakeLists.txt @@ -28,7 +28,7 @@ add_library( VtkAct ADD_VTK_DEPENDENCY(VtkAct) target_link_libraries( VtkAct - Qt4::QtCore + Qt5::Core ${VTK_LIBRARIES} logog ) diff --git a/Applications/DataExplorer/VtkVis/CMakeLists.txt b/Applications/DataExplorer/VtkVis/CMakeLists.txt index 42679e611893a3a8cc87d39e2627894162b19b13..c56f10f45a7d920913392caf5aec2f366e855c39 100644 --- a/Applications/DataExplorer/VtkVis/CMakeLists.txt +++ b/Applications/DataExplorer/VtkVis/CMakeLists.txt @@ -128,5 +128,5 @@ if(GEOTIFF_FOUND) target_link_libraries(VtkVis ${GEOTIFF_LIBRARIES}) endif() # GEOTIFF_FOUND -target_link_libraries(VtkVis Qt4::QtGui QtDataView VtkAct) +target_link_libraries(VtkVis Qt5::Gui QtDataView VtkAct) set_property(TARGET VtkVis PROPERTY FOLDER "DataExplorer") diff --git a/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp b/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp index 9795d6ea9d9d4d63263b330101b8f1b248b55d79..965140afa17d263f900bd30b016d32d58b709410 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp +++ b/Applications/DataExplorer/VtkVis/VtkVisPipeline.cpp @@ -277,6 +277,8 @@ void VtkVisPipeline::addPipelineItem(MshModel* model, const QModelIndex &idx) QModelIndex VtkVisPipeline::addPipelineItem(VtkVisPipelineItem* item, const QModelIndex &parent) { + beginResetModel(); + item->Initialize(_renderer); TreeItem* parentItem = item->parentItem(); parentItem->appendChild(item); @@ -299,7 +301,7 @@ QModelIndex VtkVisPipeline::addPipelineItem(VtkVisPipelineItem* item, const QMod if (dynamic_cast<vtkImageAlgorithm*>(item->algorithm())) static_cast<vtkImageActor*>(item->actor())->InterpolateOff(); - reset(); + endResetModel(); emit vtkVisPipelineChanged(); emit itemSelected(newIndex); diff --git a/Applications/DataExplorer/VtkVis/VtkVisPipelineView.cpp b/Applications/DataExplorer/VtkVis/VtkVisPipelineView.cpp index 909874d41809fe8a3e84704f6a54ed3294f0d6c5..486df15127a2c45b0b3bd27eba4bd56ab8501f26 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisPipelineView.cpp +++ b/Applications/DataExplorer/VtkVis/VtkVisPipelineView.cpp @@ -57,7 +57,7 @@ VtkVisPipelineView::VtkVisPipelineView( QWidget* parent /*= 0*/ ) CheckboxDelegate* checkboxDelegate = new CheckboxDelegate(this); this->setItemDelegateForColumn(1, checkboxDelegate); this->header()->setStretchLastSection(false); - this->header()->setResizeMode(QHeaderView::ResizeToContents); + this->header()->setSectionResizeMode(QHeaderView::ResizeToContents); } void VtkVisPipelineView::setModel(QAbstractItemModel* model) diff --git a/Applications/DataExplorer/main.cpp b/Applications/DataExplorer/main.cpp index 8e71f5aaed16b22408f008f7973aaf59bcc2fe9c..6c0d9aa1112950596fa124eabfa8ed3a1e12f82d 100644 --- a/Applications/DataExplorer/main.cpp +++ b/Applications/DataExplorer/main.cpp @@ -1,7 +1,8 @@ #include "mainwindow.h" #include <memory> -#include <QtGui/QApplication> +#include <QApplication> + #include <logog/include/logog.hpp> #include "LogogSimpleFormatter.h" #ifdef VTKFBXCONVERTER_FOUND diff --git a/Applications/FileIO/CMakeLists.txt b/Applications/FileIO/CMakeLists.txt index b493645270bcc06fa3bc7577fcb5b802650159fd..71b0150b0587accaa181755ca27f002fc4d4ed61 100644 --- a/Applications/FileIO/CMakeLists.txt +++ b/Applications/FileIO/CMakeLists.txt @@ -2,12 +2,12 @@ GET_SOURCE_FILES(SOURCES) if(NOT Shapelib_FOUND) list(REMOVE_ITEM SOURCES SHPInterface.h SHPInterface.cpp) endif() -if(QT4_FOUND) +if(Qt5XmlPatterns_FOUND) APPEND_SOURCE_FILES(SOURCES XmlIO/Qt) endif() APPEND_SOURCE_FILES(SOURCES Gmsh) -if(QT4_FOUND) +if(Qt5XmlPatterns_FOUND) APPEND_SOURCE_FILES(SOURCES FEFLOW) endif() @@ -22,10 +22,10 @@ include(${PROJECT_SOURCE_DIR}/scripts/cmake/OGSEnabledElements.cmake) add_library(ApplicationsFileIO ${SOURCES}) target_link_libraries(ApplicationsFileIO DataHolderLib) -if(QT4_FOUND) - target_link_libraries(ApplicationsFileIO Qt4::QtXml Qt4::QtXmlPatterns) +if(Qt5XmlPatterns_FOUND) + target_link_libraries(ApplicationsFileIO Qt5::Xml Qt5::XmlPatterns) if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND) - target_link_libraries(ApplicationsFileIO Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32) + target_link_libraries(ApplicationsFileIO Qt5::Network ${OPENSSL_LIBRARIES} ws2_32) endif() endif() diff --git a/Applications/Utils/FileConverter/CMakeLists.txt b/Applications/Utils/FileConverter/CMakeLists.txt index 53d9029c01abee251e861e614c5c82ba88dcab13..6c7d036e96b3af9383fde0182e2a7fb23f794f0a 100644 --- a/Applications/Utils/FileConverter/CMakeLists.txt +++ b/Applications/Utils/FileConverter/CMakeLists.txt @@ -1,15 +1,18 @@ +if (Qt5XmlPatterns_FOUND) + if (Shapelib_FOUND) + add_executable(ConvertSHPToGLI ConvertSHPToGLI.cpp) + set_target_properties(ConvertSHPToGLI PROPERTIES FOLDER Utilities) + target_link_libraries(ConvertSHPToGLI GeoLib Qt5::Xml ${Shapelib_LIBRARIES}) + endif() -if (QT4_FOUND AND Shapelib_FOUND) - add_executable(ConvertSHPToGLI ConvertSHPToGLI.cpp) - set_target_properties(ConvertSHPToGLI PROPERTIES FOLDER Utilities) - target_link_libraries(ConvertSHPToGLI GeoLib Qt4::QtXml ${Shapelib_LIBRARIES}) -endif () - -if (QT4_FOUND) add_executable(FEFLOW2OGS FEFLOW2OGS.cpp) set_target_properties(FEFLOW2OGS PROPERTIES FOLDER Utilities) target_link_libraries(FEFLOW2OGS ApplicationsFileIO) ADD_VTK_DEPENDENCY(FEFLOW2OGS) + + add_executable(convertGEO convertGEO.cpp) + set_target_properties(convertGEO PROPERTIES FOLDER Utilities) + target_link_libraries(convertGEO GeoLib) endif () add_executable(generateMatPropsFromMatID generateMatPropsFromMatID.cpp ) @@ -43,20 +46,18 @@ set_target_properties(TIN2VTK PROPERTIES FOLDER Utilities) target_link_libraries(TIN2VTK MeshLib) ADD_VTK_DEPENDENCY(TIN2VTK) -if (QT4_FOUND) - add_executable(convertGEO convertGEO.cpp) - set_target_properties(convertGEO PROPERTIES FOLDER Utilities) - target_link_libraries(convertGEO GeoLib) -endif() - #################### ### Installation ### #################### install(TARGETS generateMatPropsFromMatID GMSH2OGS OGS2VTK VTK2OGS VTK2TIN RUNTIME DESTINATION bin COMPONENT ogs_converter) -if(QT4_FOUND) - install(TARGETS ConvertSHPToGLI FEFLOW2OGS convertGEO +if(Qt5XmlPatterns_FOUND) + if(Shapelib_FOUND) + install(TARGETS ConvertSHPToGLI + RUNTIME DESTINATION bin COMPONENT ogs_converter) + endif() + install(TARGETS FEFLOW2OGS convertGEO RUNTIME DESTINATION bin COMPONENT ogs_converter) endif() diff --git a/Applications/Utils/GeoTools/CMakeLists.txt b/Applications/Utils/GeoTools/CMakeLists.txt index 8144402f4494add9729445d0544b621065596639..82cbb066974e94c626a3ced9d527b6cfc4e43502 100644 --- a/Applications/Utils/GeoTools/CMakeLists.txt +++ b/Applications/Utils/GeoTools/CMakeLists.txt @@ -1,4 +1,4 @@ -if(QT4_FOUND) +if(Qt5XmlPatterns_FOUND) add_executable(TriangulatePolyline TriangulatePolyline.cpp) target_link_libraries(TriangulatePolyline GeoLib) set_target_properties(TriangulatePolyline PROPERTIES FOLDER Utilities) @@ -16,4 +16,4 @@ if(QT4_FOUND) RUNTIME DESTINATION bin COMPONENT Utilities ) -endif() # QT4_FOUND +endif() diff --git a/Applications/Utils/OGSFileConverter/CMakeLists.txt b/Applications/Utils/OGSFileConverter/CMakeLists.txt index 03f5544798865d25e8b5a0d0ac35e7969f341c25..a6e347979325e13f94cd4c59e15487fe7c055bfc 100644 --- a/Applications/Utils/OGSFileConverter/CMakeLists.txt +++ b/Applications/Utils/OGSFileConverter/CMakeLists.txt @@ -13,7 +13,7 @@ set(SOURCES OGSFileConverter.cpp ) -find_package(Qt4 QUIET REQUIRED) +find_package(Qt5 QUIET REQUIRED Gui Widgets Xml XmlPatterns) include_directories( ${CMAKE_BINARY_DIR}/Applications/Utils/OGSFileConverter @@ -47,8 +47,6 @@ target_link_libraries(OGSFileConverter GeoLib) ADD_VTK_DEPENDENCY(OGSFileConverter) -include(${QT_USE_FILE}) - set(CMAKE_CONFIGURATION_TYPES "Release;Debug" CACHE TYPE INTERNAL FORCE) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) diff --git a/Applications/Utils/OGSFileConverter/main.cpp b/Applications/Utils/OGSFileConverter/main.cpp index f04d37c7abc9e8702066677bf3d827225d815a18..5a19d03f3835752f998bc647f7fcf593e3292084 100644 --- a/Applications/Utils/OGSFileConverter/main.cpp +++ b/Applications/Utils/OGSFileConverter/main.cpp @@ -13,7 +13,8 @@ #include "Applications/ApplicationsLib/LogogSetup.h" -#include <QtGui/QApplication> +#include <QApplication> + int main(int argc, char* argv[]) { diff --git a/BaseLib/CMakeLists.txt b/BaseLib/CMakeLists.txt index 5a1bc9ee4693695e9e768e45b7ae319cbce58ab2..f1ffd71688d5cdfe6150bf7ae2d01d8a6cde34f6 100644 --- a/BaseLib/CMakeLists.txt +++ b/BaseLib/CMakeLists.txt @@ -3,7 +3,7 @@ APPEND_SOURCE_FILES(SOURCES IO) APPEND_SOURCE_FILES(SOURCES IO/XmlIO) -if(QT4_FOUND) +if(Qt5XmlPatterns_FOUND) APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Qt) endif() @@ -22,10 +22,10 @@ if(MSVC) target_link_libraries(BaseLib WinMM) # needed for timeGetTime endif() -if(QT4_FOUND) - target_link_libraries(BaseLib Qt4::QtXml Qt4::QtXmlPatterns) +if(Qt5XmlPatterns_FOUND) + target_link_libraries(BaseLib Qt5::Xml Qt5::XmlPatterns) if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND) - target_link_libraries(BaseLib Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32) + target_link_libraries(BaseLib Qt5::Network ${OPENSSL_LIBRARIES} ws2_32) endif() endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 65d3aac1c361abcfa2bad5de0f7dd7c5df2e2258..825e2ba6ca8b97d9636bf12a1ecea2ef4ac4a948 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,4 +244,3 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/BaseLib/BuildInfo.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/BaseLib/BuildInfo.cpp" @ONLY) include(scripts/cmake/MarkVariablesAdvanced.cmake) -include(scripts/cmake/packaging/GetDependencies.cmake) diff --git a/GeoLib/CMakeLists.txt b/GeoLib/CMakeLists.txt index 47e6599dbd0d1e9f9092cbe68fdb6b8e73e94cf7..fdf788ef33cb74780fa4d4ed0c04fe578bcae096 100644 --- a/GeoLib/CMakeLists.txt +++ b/GeoLib/CMakeLists.txt @@ -7,7 +7,7 @@ APPEND_SOURCE_FILES(SOURCES IO/Legacy) APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Rapid) APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Boost) -if(QT4_FOUND) +if(Qt5XmlPatterns_FOUND) APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Qt) endif() @@ -20,10 +20,10 @@ target_link_libraries(GeoLib MathLib ) -if(QT4_FOUND) - target_link_libraries(GeoLib Qt4::QtXml Qt4::QtXmlPatterns) +if(Qt5XmlPatterns_FOUND) + target_link_libraries(GeoLib Qt5::Xml Qt5::XmlPatterns) if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND) - target_link_libraries(GeoLib Qt4::QtNetwork ${OPENSSL_LIBRARIES} ws2_32) + target_link_libraries(GeoLib Qt5::Network ${OPENSSL_LIBRARIES} ws2_32) endif() endif() diff --git a/Jenkinsfile b/Jenkinsfile index 8913f60c8879df311e3620bc0261837ee0a32401..02804452f1d04463c65ce6305f7ded3bfa96607e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -@Library('jenkins-pipeline@1.0.0') _ +@Library('jenkins-pipeline@1.0.1') _ def builders = [:] def helper = new ogs.helper() @@ -13,6 +13,13 @@ builders['gcc'] = { } } +builders['gcc-conan'] = { + node('docker') { + dir('ogs') { checkout scm } + load 'ogs/scripts/jenkins/gcc-conan.groovy' + } +} + builders['gcc-dynamic'] = { node('envinf1') { dir('ogs') { checkout scm } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 90a82855296c29fe16e0dba9ab4eb196e7c1a965..5d93e293cc2620407459660ec186f3d6b3a963db 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -20,7 +20,7 @@ APPEND_SOURCE_FILES(TEST_SOURCES NumLib) APPEND_SOURCE_FILES(TEST_SOURCES ProcessLib) APPEND_SOURCE_FILES(TEST_SOURCES ProcessLib/LiquidFlow) -if(QT4_FOUND) +if(Qt5XmlPatterns_FOUND) APPEND_SOURCE_FILES(TEST_SOURCES FileIO_Qt) endif() @@ -56,20 +56,12 @@ if(OGS_USE_MPI) target_link_libraries(testrunner ${MPI_CXX_LIBRARIES}) endif() -if(OGS_BUILD_GUI) - target_link_libraries(testrunner - QtDataView - QtStratView - VtkVis - ) -endif() - if(OGS_BUILD_SWMM) target_link_libraries(testrunner SwmmInterface) endif() -if(QT4_FOUND) - target_link_libraries(testrunner Qt4::QtCore Qt4::QtGui Qt4::QtXml Qt4::QtNetwork) +if(Qt5XmlPatterns_FOUND) + target_link_libraries(testrunner Qt5::Core Qt5::Gui Qt5::Xml Qt5::Network) if(CMAKE_CROSSCOMPILING) target_link_libraries(testrunner ${QT_XML_DEPS_LIBRARIES} diff --git a/Tests/testrunner.cpp b/Tests/testrunner.cpp index b14fe810ef19a7ea905c8860e3d731d66ecbc8d1..ff54882b6849741469d75a777d51316bcb3e3ed0 100644 --- a/Tests/testrunner.cpp +++ b/Tests/testrunner.cpp @@ -24,7 +24,7 @@ #include "BaseLib/TemplateLogogFormatterSuppressedGCC.h" #ifdef OGS_BUILD_GUI -#include <QApplication> +#include <QCoreApplication> #endif /// Implementation of the googletest testrunner @@ -41,7 +41,7 @@ int main(int argc, char* argv[]) setlocale(LC_ALL, "C"); #ifdef OGS_BUILD_GUI - QApplication app(argc, argv, false); + QCoreApplication app(argc, argv, false); #endif // Attention: Order matters! diff --git a/ThirdParty/CMakeLists.txt b/ThirdParty/CMakeLists.txt index 9ce23dbd69d5cef6e964abaceade8861af8626b9..57e0d5402a6ac0cfdd89017924df6f5e381bc88e 100644 --- a/ThirdParty/CMakeLists.txt +++ b/ThirdParty/CMakeLists.txt @@ -28,11 +28,7 @@ endif() # tetgen if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tetgen/CMakeLists.txt) add_subdirectory(tetgen) - if(APPLE AND OGS_BUILD_GUI) - install (PROGRAMS $<TARGET_FILE:tetgen> DESTINATION DataExplorer.app/Contents/MacOS COMPONENT ogs_extras) - else() - install (PROGRAMS $<TARGET_FILE:tetgen> DESTINATION bin COMPONENT ogs_extras) - endif() + install (PROGRAMS $<TARGET_FILE:tetgen> DESTINATION bin COMPONENT ogs_extras) endif() # vtkdiff diff --git a/ThirdParty/vtkGUISupportQt b/ThirdParty/vtkGUISupportQt index d62669aa81ce58c91e35273a7f7ddde3ced8db9f..5f5cab9dc84524c2fe0374a29527b8467e4643f9 160000 --- a/ThirdParty/vtkGUISupportQt +++ b/ThirdParty/vtkGUISupportQt @@ -1 +1 @@ -Subproject commit d62669aa81ce58c91e35273a7f7ddde3ced8db9f +Subproject commit 5f5cab9dc84524c2fe0374a29527b8467e4643f9 diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000000000000000000000000000000000000..0f61c2bfdbcf3aed62dde93995b0b74f6e70c81c --- /dev/null +++ b/conanfile.py @@ -0,0 +1,31 @@ +from conans import ConanFile, CMake + +class OpenGeoSysConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + requires = \ + "Boost/[>=1.56.0]@lasote/stable", \ + "Shapelib/1.3.0@bilke/stable", \ + "VTK/[>=6.3,<7.1]@bilke/stable", \ + "Eigen3/3.2.8@bilke/stable", \ + "libgeotiff/1.4.2@bilke/stable", \ + "Qt/5.6.2@bilke/testing" + + generators = "cmake" + + default_options = \ + "Boost:shared=False", \ + "Boost:header_only=True", \ + "Qt:xmlpatterns=True" + + def imports(self): + self.copy(pattern="*.dll", dst="bin", src="bin") + self.copy(pattern="*.dylib*", dst="bin", src="lib") + self.copy(pattern="*.framework*", dst="bin", src="lib") + self.copy(pattern="*.dll", dst="bin/platforms", src="plugins/platforms") + self.copy(pattern="*.dylib*", dst="bin/platforms", src="plugins/platforms") + + def build(self): + cmake = CMake(self.settings) + self.run('cmake "%s" %s' % (self.conanfile_directory, cmake.command_line)) + self.run('cmake --build . %s' % cmake.build_config) diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index a0440b2ebb296d46f170ed4f73502fc9b24d020c..0000000000000000000000000000000000000000 --- a/conanfile.txt +++ /dev/null @@ -1,13 +0,0 @@ -[requires] -Boost/1.60.0@lasote/stable -Shapelib/1.3.0@bilke/stable -VTK/7.0.0@bilke/stable -Eigen3/3.2.8@bilke/stable -libgeotiff/1.4.1@bilke/stable - -[generators] -cmake - -[options] -Boost:shared=False -Boost:header_only=True diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index c91cf3417491784590af10b001010f734ed9997a..ed14e951f76ab6dc3cf6f8babfc6536d932f87df 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -94,18 +94,21 @@ endif() find_package(Metis QUIET) -## Qt4 library ## +## Qt5 library ## if(OGS_BUILD_GUI) - find_package( Qt4 4.7 REQUIRED QtGui QtXml QtXmlPatterns) + if(USE_CONAN) + set(Qt5_DIR ${CONAN_QT_ROOT}/lib/cmake/Qt5) + endif() + find_package( Qt5 5.2 REQUIRED Gui Widgets Xml XmlPatterns) cmake_policy(SET CMP0020 NEW) if(CMAKE_CROSSCOMPILING) find_package(PkgConfig REQUIRED) - pkg_check_modules(QT_XML_DEPS REQUIRED QtXml) - list(REMOVE_ITEM QT_XML_DEPS_LIBRARIES QtXml QtCore) - pkg_check_modules(QT_GUI_DEPS REQUIRED QtGui) - list(REMOVE_ITEM QT_GUI_DEPS_LIBRARIES QtGui QtCore) - pkg_check_modules(QT_NETWORK_DEPS REQUIRED QtNetwork) - list(REMOVE_ITEM QT_NETWORK_DEPS_LIBRARIES QtNetwork QtCore) + pkg_check_modules(QT_XML_DEPS REQUIRED Xml) + list(REMOVE_ITEM QT_XML_DEPS_LIBRARIES Xml Core) + pkg_check_modules(QT_GUI_DEPS REQUIRED Gui) + list(REMOVE_ITEM QT_GUI_DEPS_LIBRARIES Gui Core) + pkg_check_modules(QT_NETWORK_DEPS REQUIRED Network) + list(REMOVE_ITEM QT_NETWORK_DEPS_LIBRARIES Network Core) endif() endif() diff --git a/scripts/cmake/packaging/InstallXmlSchemaFiles.cmake b/scripts/cmake/packaging/InstallXmlSchemaFiles.cmake index 3a5d8e072a1dbf73536a59dfc83ecdfa23df8db6..0a5d8e6882eb434c09ec0b90a6ba663c0c534650 100644 --- a/scripts/cmake/packaging/InstallXmlSchemaFiles.cmake +++ b/scripts/cmake/packaging/InstallXmlSchemaFiles.cmake @@ -1,8 +1,4 @@ macro(InstallXmlSchemaFiles GLOB_EXPRESSION) file(GLOB XSD_FILES . ${GLOB_EXPRESSION}) - if(APPLE AND OGS_BUILD_GUI) - install(FILES ${XSD_FILES} DESTINATION ${CMAKE_BINARY_DIR}/_CPack_Packages/Darwin/DragNDrop/${CPACK_PACKAGE_FILE_NAME}/ALL_IN_ONE/DataExplorer.app/Contents/MacOS COMPONENT ogs_gui) - else() - install(FILES ${XSD_FILES} DESTINATION bin COMPONENT ogs_cli) - endif() + install(FILES ${XSD_FILES} DESTINATION bin COMPONENT ogs_cli) endmacro() diff --git a/scripts/cmake/packaging/Pack.cmake b/scripts/cmake/packaging/Pack.cmake index 2dd860b4c007bfb191ef6769125c57daf2c99a51..a7f56030c7f9d53a782e405e7ebbc0c25513e70d 100644 --- a/scripts/cmake/packaging/Pack.cmake +++ b/scripts/cmake/packaging/Pack.cmake @@ -40,10 +40,11 @@ if (WIN32) include (packaging/PackagingWin) endif() if(UNIX) - include (packaging/PackagingLinux) -endif() -if(APPLE) - include (packaging/PackagingMac) + if(APPLE) + include (packaging/PackagingMac) + else() + include (packaging/PackagingLinux) + endif() endif() # Download additional content @@ -101,17 +102,18 @@ cpack_add_component(ogs_docs GROUP Utilities ) -# Clear cache variable holding all targets to install dependencies for. -unset(INSTALL_DEPENDENCIES CACHE) +if(USE_CONAN) + # Install shared libraries, copied to bin-dir + foreach(PATTERN "*.dll" "*.dylib") + file(GLOB MATCHED_FILES ${EXECUTABLE_OUTPUT_PATH}/${PATTERN}) + install(FILES ${MATCHED_FILES} DESTINATION bin) + endforeach() -if(WIN32) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/packaging/package.cmd.in - ${CMAKE_CURRENT_BINARY_DIR}/package.cmd - ) -else() - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cmake/packaging/package.sh.in - ${CMAKE_CURRENT_BINARY_DIR}/package.sh - ) + # macOS frameworks are directories, exclude header files + file(GLOB MATCHED_DIRECTORIES "${EXECUTABLE_OUTPUT_PATH}/*.framework") + install(DIRECTORY ${MATCHED_DIRECTORIES} DESTINATION bin + PATTERN "Headers" EXCLUDE) + + # Install Qt platform shared libraries + install(DIRECTORY ${EXECUTABLE_OUTPUT_PATH}/platforms DESTINATION bin OPTIONAL) endif() diff --git a/scripts/cmake/packaging/PackagingMac.cmake b/scripts/cmake/packaging/PackagingMac.cmake index 803724dac259f9c469e3c3104e9fc23d0c7a1bd0..8b32b22bc59be158d15b490a933412ee8bb1f7d0 100644 --- a/scripts/cmake/packaging/PackagingMac.cmake +++ b/scripts/cmake/packaging/PackagingMac.cmake @@ -1,3 +1,5 @@ +set(CPACK_GENERATOR TGZ) + option(OGS_PACK_DMG "package targets creates a .dmg disk image instead of .tar.gz" FALSE) if(OGS_PACK_DMG) if(NOT OGS_BUILD_GUI) @@ -10,3 +12,7 @@ set(CPACK_DMG_FORMAT "UDBZ") # See http://stackoverflow.com/a/16662169/80480 how to create the DS_Store file. set(CPACK_DMG_BACKGROUND_IMAGE ${CMAKE_SOURCE_DIR}/Documentation/OpenGeoSys-Logo.png) set(CPACK_DMG_DS_STORE ${CMAKE_SOURCE_DIR}/scripts/packaging/.DS_Store) + +if(USE_CONAN) + SET(CMAKE_INSTALL_RPATH "@executable_path") +endif() diff --git a/scripts/env/envinf1/cli.sh b/scripts/env/envinf1/cli.sh index 40a5d04bd3bea1778f778702c4392c9ab2735c50..2b3a1aab1ae285d287b807130ed03342196a441f 100644 --- a/scripts/env/envinf1/cli.sh +++ b/scripts/env/envinf1/cli.sh @@ -12,3 +12,4 @@ module load vtk/6.3.0_openmpi-1.8.4-noqt-1 # Tools module load numdiff/5.8.1-1 module load coreutils/8.21-1 +module load ccache/3.3.3 diff --git a/scripts/jenkins/docs.groovy b/scripts/jenkins/docs.groovy index 86213d2ea4f6753e29d8f087dd1450ac57cb7f71..503378314e57616bdda43da67fcf80cedc26f106 100644 --- a/scripts/jenkins/docs.groovy +++ b/scripts/jenkins/docs.groovy @@ -12,11 +12,11 @@ def image = docker.image('ogs6/gcc-latex:latest') image.pull() image.inside() { stage('Configure (Docs)') { - configure.linux 'build', "${defaultCMakeOptions}" + configure.linux(cmakeOptions: defaultCMakeOptions, script: this) } stage('Generate (Docs)') { - build.linux 'build', 'doc' + build.linux(script: this, target: 'doc') } } diff --git a/scripts/jenkins/gcc-conan.groovy b/scripts/jenkins/gcc-conan.groovy new file mode 100644 index 0000000000000000000000000000000000000000..a3887dcf8410a78da56ed17fe653428617021898 --- /dev/null +++ b/scripts/jenkins/gcc-conan.groovy @@ -0,0 +1,59 @@ +def defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache ' + + '-v /home/jenkins/conan-data:/root/.conan/data' + +def defaultCMakeOptions = + '-DCMAKE_BUILD_TYPE=Release ' + + '-DOGS_LIB_BOOST=System ' + + '-DOGS_LIB_VTK=System ' + +def guiCMakeOptions = + '-DOGS_BUILD_CLI=OFF ' + + '-DOGS_BUILD_GUI=ON ' + + '-DOGS_BUILD_UTILS=ON ' + + '-DOGS_BUILD_TESTS=OFF ' + + '-DOGS_BUILD_METIS=ON ' + +def configure = new ogs.configure() +def build = new ogs.build() +def post = new ogs.post() +def helper = new ogs.helper() + +def image = docker.image('ogs6/gcc-conan') +image.pull() +image.inside(defaultDockerArgs) { + stage('Configure (Linux-Docker)') { + configure.linux( + cmakeOptions: defaultCMakeOptions, + script: this, + useConan: true + ) + } + + stage('CLI (Linux-Docker)') { + build.linux(script: this) + } + + stage('Test (Linux-Docker)') { + build.linux(script: this, target: 'tests ctest') + } + + stage('Data Explorer (Linux-Docker)') { + configure.linux( + cmakeOptions: defaultCMakeOptions + guiCMakeOptions, + keepDir: true, + script: this, + useConan: true + ) + build.linux(script: this) + } +} + +stage('Archive (Linux-Docker)') { + archiveArtifacts 'build/*.tar.gz' +} + +stage('Post (Linux-Docker)') { + post.publishTestReports 'build/Testing/**/*.xml', 'build/Tests/testrunner.xml', + 'ogs/scripts/jenkins/clang-log-parser.rules' + post.cleanup() +} diff --git a/scripts/jenkins/gcc-dynamic.groovy b/scripts/jenkins/gcc-dynamic.groovy index e65e32c77e9d4ffebaa0d476b812c66ad0f22f25..d213d050951ed46f5ab34b2a4a02176317953888 100644 --- a/scripts/jenkins/gcc-dynamic.groovy +++ b/scripts/jenkins/gcc-dynamic.groovy @@ -11,15 +11,15 @@ def post = new ogs.post() def helper = new ogs.helper() stage('Configure (Linux-Docker-Dynamic)') { - configure.linuxWithEnv('envinf1/cli.sh', 'build', "${defaultCMakeOptions}") + configure.linux(cmakeOptions: defaultCMakeOptions, env: 'envinf1/cli.sh', script: this) } stage('CLI (Linux-Docker-Dynamic)') { - build.linuxWithEnv('envinf1/cli.sh', 'build') + build.linux(env: 'envinf1/cli.sh', script: this) } stage('Test (Linux-Docker-Dynamic)') { - build.linuxWithEnv('envinf1/cli.sh', 'build', 'tests ctest') + build.linux(env: 'envinf1/cli.sh', script: this, target: 'tests ctest') } stage('Post (Linux-Docker-Dynamic)') { diff --git a/scripts/jenkins/gcc-tests-large.groovy b/scripts/jenkins/gcc-tests-large.groovy index c95acb84d5eb5e6cc70a14cd1ada8ab00c24b4d6..5e269dbc3bdd8c13ec05fafff8ec877f96f59bb0 100644 --- a/scripts/jenkins/gcc-tests-large.groovy +++ b/scripts/jenkins/gcc-tests-large.groovy @@ -15,9 +15,9 @@ node('docker') { def image = docker.image('ogs6/gcc-gui:latest') image.pull() image.inside(defaultDockerArgs) { - stage('Configure') { configure.linux 'build', "${defaultCMakeOptions}" } - stage('Build') { build.linux 'build' } - stage('Test') { build.linux 'build', 'tests ctest-large' } + stage('Configure') { configure.linux(cmakeOptions: defaultCMakeOptions, script: this) } + stage('Build') { build.linux(script: this) } + stage('Test') { build.linux(script: this, target: 'tests ctest-large') } } stage('Post') { diff --git a/scripts/jenkins/gcc.groovy b/scripts/jenkins/gcc.groovy index 1d1b74ed2486faa06e165074a1c2a13572c9ef4c..19e591e89e59827bf0fc4d3a531d662c8782ea12 100644 --- a/scripts/jenkins/gcc.groovy +++ b/scripts/jenkins/gcc.groovy @@ -2,7 +2,14 @@ def defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache' def defaultCMakeOptions = '-DCMAKE_BUILD_TYPE=Release ' + '-DOGS_LIB_BOOST=System ' + - '-DOGS_LIB_VTK=System' + '-DOGS_LIB_VTK=System ' + +def guiCMakeOptions = + '-DOGS_BUILD_CLI=OFF ' + + '-DOGS_BUILD_GUI=ON ' + + '-DOGS_BUILD_UTILS=ON ' + + '-DOGS_BUILD_TESTS=OFF ' + + '-DOGS_BUILD_METIS=ON ' def configure = new ogs.configure() def build = new ogs.build() @@ -13,30 +20,27 @@ def image = docker.image('ogs6/gcc-gui:latest') image.pull() image.inside(defaultDockerArgs) { stage('Configure (Linux-Docker)') { - configure.linux 'build', "${defaultCMakeOptions}" + configure.linux(cmakeOptions: defaultCMakeOptions, script: this) } stage('CLI (Linux-Docker)') { - build.linux 'build' + build.linux(script: this) } stage('Test (Linux-Docker)') { - build.linux 'build', 'tests ctest' + build.linux(script: this, target: 'tests ctest') } stage('Data Explorer (Linux-Docker)') { - configure.linux 'build', "${defaultCMakeOptions} " + - '-DOGS_BUILD_CLI=OFF -DOGS_BUILD_GUI=ON -DOGS_BUILD_UTILS=ON ' + - '-DOGS_BUILD_TESTS=OFF -DOGS_BUILD_METIS=ON', - 'Unix Makefiles', null, true - build.linux 'build' + configure.linux( + cmakeOptions: defaultCMakeOptions + guiCMakeOptions, + keepDir: true, + script: this + ) + build.linux(script: this) } } -stage('Archive (Linux-Docker)') { - archiveArtifacts 'build/*.tar.gz' -} - stage('Post (Linux-Docker)') { post.publishTestReports 'build/Testing/**/*.xml', 'build/Tests/testrunner.xml', 'ogs/scripts/jenkins/clang-log-parser.rules' diff --git a/scripts/jenkins/mac.groovy b/scripts/jenkins/mac.groovy index 7dedbfe75218943aefa560e0e7937fa461bd7c1f..4cb8e7f5235d5d641f4f165b043a9b92fac81e12 100644 --- a/scripts/jenkins/mac.groovy +++ b/scripts/jenkins/mac.groovy @@ -4,7 +4,13 @@ def defaultCMakeOptions = '-DOGS_LIB_BOOST=System' + '-DOGS_LIB_VTK=System ' + '-DOGS_DOWNLOAD_ADDITIONAL_CONTENT=ON ' + - '-DCMAKE_OSX_DEPLOYMENT_TARGET="10.11"' + '-DCMAKE_OSX_DEPLOYMENT_TARGET="10.11" ' + +def guiCMakeOptions = + '-DOGS_BUILD_GUI=ON ' + + '-DOGS_BUILD_UTILS=ON ' + + '-DOGS_BUILD_TESTS=OFF ' + + '-DOGS_BUILD_METIS=ON ' def configure = new ogs.configure() def build = new ogs.build() @@ -12,27 +18,34 @@ def post = new ogs.post() def helper = new ogs.helper() stage('Configure (Mac)') { - configure.linux 'build', "${defaultCMakeOptions}", 'Ninja', '' + configure.linux( + cmakeOptions: defaultCMakeOptions, + generator: 'Ninja', + script: this, + useConan: true + ) } stage('CLI (Mac)') { - build.linux 'build', null, 'ninja' + build.linux(cmd: 'ninja', script: this) } stage('Test (Mac)') { - build.linux 'build', 'tests ctest', 'ninja' + build.linux(cmd: 'ninja', script: this, target: 'tests ctest') } stage('Data Explorer (Mac)') { - configure.linux 'build', "${defaultCMakeOptions} " + - '-DOGS_BUILD_GUI=ON -DOGS_BUILD_UTILS=ON -DOGS_BUILD_TESTS=OFF ' + - '-DOGS_BUILD_METIS=ON', - 'Ninja', '', true - build.linux 'build', null, 'ninja' + configure.linux( + cmakeOptions: defaultCMakeOptions + guiCMakeOptions, + generator: 'Ninja', + keepDir: true, + script: this + ) + build.linux(cmd: 'ninja', script: this) } stage('Archive (Mac)') { - archiveArtifacts 'build/*.tar.gz,build/*.dmg' + archiveArtifacts 'build/*.tar.gz,build/*.dmg,build/conaninfo.txt' } stage('Post (Mac)') { diff --git a/scripts/jenkins/msvc.groovy b/scripts/jenkins/msvc.groovy index 5e9d9c45ee48bab328cb0d616a4e8560fe732131..ba434311e4d413547cf4686eb277c35372e15e41 100644 --- a/scripts/jenkins/msvc.groovy +++ b/scripts/jenkins/msvc.groovy @@ -1,6 +1,5 @@ def defaultCMakeOptions = - '-DCMAKE_BUILD_TYPE=Release ' + '-DOGS_LIB_BOOST=System ' + '-DOGS_LIB_VTK=System ' + '-DOGS_DOWNLOAD_ADDITIONAL_CONTENT=ON' @@ -19,30 +18,29 @@ def helper = new ogs.helper() withEnv(helper.getEnv(this)) { stage('Configure (Win)') { - configure.win 'build', "${defaultCMakeOptions}", 'Ninja', - '-u -s build_type=Release -s compiler="Visual Studio" ' + - '-s compiler.version=12 -s arch=x86_64' + configure.win(cmakeOptions: defaultCMakeOptions, script: this) } stage('CLI (Win)') { - build.win this, 'build' + build.win(script: this) } stage('Test (Win)') { - build.win this, 'build', 'tests' - build.win this, 'build', 'ctest' + build.win(script: this, target: 'tests') + build.win(script: this, target: 'ctest') } stage('Data Explorer (Win)') { - configure.win 'build', "${defaultCMakeOptions} ${guiCMakeOptions}", - 'Ninja', '-u -s build_type=Release -s compiler="Visual Studio" ' + - '-s compiler.version=12 -s arch=x86_64', true - build.win this, 'build' + configure.win( + cmakeOptions: defaultCMakeOptions + ' ' + guiCMakeOptions, keepDir: true, + script: this + ) + build.win(script: this) } } stage('Archive (Win)') { - archiveArtifacts 'build/*.zip' + archiveArtifacts 'build/*.zip,build/conaninfo.txt' } stage('Post (Win)') { diff --git a/scripts/jenkins/msvc32.groovy b/scripts/jenkins/msvc32.groovy index 633abcfc04704e8b2e2a259805fa16a17289b16f..ff26322ce9db2ff0a9ba4a8cd9dc9664487dd4ad 100644 --- a/scripts/jenkins/msvc32.groovy +++ b/scripts/jenkins/msvc32.groovy @@ -3,7 +3,13 @@ def defaultCMakeOptions = '-DOGS_32_BIT=ON ' + '-DOGS_LIB_BOOST=System ' + '-DOGS_LIB_VTK=System ' + - '-DOGS_DOWNLOAD_ADDITIONAL_CONTENT=ON' + '-DOGS_DOWNLOAD_ADDITIONAL_CONTENT=ON ' + +def guiCMakeOptions = + '-DOGS_BUILD_GUI=ON ' + + '-DOGS_BUILD_UTILS=ON ' + + '-DOGS_BUILD_TESTS=OFF ' + + '-DOGS_BUILD_METIS=ON ' def configure = new ogs.configure() def build = new ogs.build() @@ -13,16 +19,16 @@ def helper = new ogs.helper() withEnv(helper.getEnv(this, 'x32')) { stage('Data Explorer 32-bit (Win)') { - configure.win 'build-32', "${defaultCMakeOptions} " + - '-DOGS_BUILD_GUI=ON -DOGS_BUILD_UTILS=ON -DOGS_BUILD_TESTS=OFF ' + - '-DOGS_BUILD_METIS=ON', - 'Ninja', '-u -s build_type=Release -s compiler="Visual ' + - 'Studio" -s compiler.version=12 -s arch=x86' - build.win this, 'build-32' + configure.win( + arch: 'x86', + cmakeOptions: defaultCMakeOptions + guiCMakeOptions, + script: this + ) + build.win(script: this) } } stage('Post 32-bit (Win)') { - archiveArtifacts 'build-32/*.zip' - post.cleanup('build-32') + archiveArtifacts 'build/*.zip' + post.cleanup('build') }