diff --git a/Applications/DataExplorer/DataExplorer.cmake b/Applications/DataExplorer/DataExplorer.cmake index 680d316c696095d7ae1f97c7690c74727e59eb24..10de32e5976cdd96d45384ac9e518975eaf48497 100644 --- a/Applications/DataExplorer/DataExplorer.cmake +++ b/Applications/DataExplorer/DataExplorer.cmake @@ -60,8 +60,6 @@ if(OGS_USE_NETCDF) endif() if(NOT APPLE AND OGS_USE_CONAN) - # HACK for unresolved external - target_link_libraries(DataExplorer vtkGUISupportQt-8.1) if(UNIX) target_link_libraries(DataExplorer Qt5::X11Extras) endif() @@ -73,14 +71,6 @@ if(OGS_USE_CONAN AND WIN32) target_link_libraries(DataExplorer ${ZLIB_LIBRARIES}) endif() -if(CMAKE_CROSSCOMPILING) - target_link_libraries(DataExplorer - ${QT_XML_DEPS_LIBRARIES} - ${QT_GUI_DEPS_LIBRARIES} - ${QT_NETWORK_DEPS_LIBRARIES} - ) -endif() - if(GEOTIFF_FOUND) target_link_libraries(DataExplorer ${GEOTIFF_LIBRARIES} ) endif() diff --git a/Applications/DataExplorer/VtkVis/CMakeLists.txt b/Applications/DataExplorer/VtkVis/CMakeLists.txt index f873f6c550e34b9735fb6fee772a7255e3d104ed..839a590fe0f7552d9683d9c3886a614529c87c63 100644 --- a/Applications/DataExplorer/VtkVis/CMakeLists.txt +++ b/Applications/DataExplorer/VtkVis/CMakeLists.txt @@ -146,10 +146,6 @@ if (OGS_USE_NETCDF) target_link_libraries(VtkVis PRIVATE NetCdfDialogLib) endif() -if(NOT APPLE AND OGS_USE_CONAN) - # HACK for unresolved external - target_link_libraries(VtkVis PUBLIC vtkGUISupportQt-8.1) -endif() set_property(TARGET VtkVis PROPERTY FOLDER "DataExplorer") add_autogen_include(VtkVis) diff --git a/Applications/FileIO/CMakeLists.txt b/Applications/FileIO/CMakeLists.txt index 91b4dfc6a13b055d0c8f5940b2248b0699f2175e..eaaed88a542e0d7c55ec7e10c2c56e1d73976690 100644 --- a/Applications/FileIO/CMakeLists.txt +++ b/Applications/FileIO/CMakeLists.txt @@ -10,7 +10,7 @@ endif() GET_SOURCE_FILES(SOURCES_GO2OGS GocadIO) set(SOURCES ${SOURCES} ${SOURCES_GO2OGS}) -if(Qt5XmlPatterns_FOUND) +if(OGS_BUILD_GUI) APPEND_SOURCE_FILES(SOURCES XmlIO/Qt) APPEND_SOURCE_FILES(SOURCES FEFLOW) endif() diff --git a/Applications/Utils/FileConverter/CMakeLists.txt b/Applications/Utils/FileConverter/CMakeLists.txt index 1aadd39f884916d58ca63d9dcb5866678b42ddcb..d280d8c55580d43be7c9d3ae8ddb6da8006e8ede 100644 --- a/Applications/Utils/FileConverter/CMakeLists.txt +++ b/Applications/Utils/FileConverter/CMakeLists.txt @@ -1,4 +1,4 @@ -if (Qt5XmlPatterns_FOUND) +if (OGS_BUILD_GUI) if (Shapelib_FOUND) add_executable(ConvertSHPToGLI ConvertSHPToGLI.cpp) set_target_properties(ConvertSHPToGLI PROPERTIES FOLDER Utilities) @@ -79,7 +79,7 @@ install(TARGETS Mesh2Raster RUNTIME DESTINATION bin COMPONENT ogs_converter) -if(Qt5XmlPatterns_FOUND) +if(OGS_BUILD_GUI) if(Shapelib_FOUND) install(TARGETS ConvertSHPToGLI RUNTIME DESTINATION bin COMPONENT ogs_converter) diff --git a/Applications/Utils/GeoTools/CMakeLists.txt b/Applications/Utils/GeoTools/CMakeLists.txt index 0d0723a436daad2b5436e3268e10099f88c2a5ac..e65cb74e20e3a86c5c20d2cbf6aa875d3cc26e40 100644 --- a/Applications/Utils/GeoTools/CMakeLists.txt +++ b/Applications/Utils/GeoTools/CMakeLists.txt @@ -1,4 +1,4 @@ -if(NOT Qt5XmlPatterns_FOUND) +if(NOT OGS_BUILD_GUI) return() endif() diff --git a/BaseLib/CMakeLists.txt b/BaseLib/CMakeLists.txt index ec1c2013b1818a51295150d6498a877e7d369172..52f8a8e03dbe8ee131757bd08e5b88eb48eece96 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(Qt5XmlPatterns_FOUND) +if(OGS_BUILD_GUI) APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Qt) endif() @@ -25,11 +25,8 @@ if(MSVC) target_link_libraries(BaseLib PUBLIC WinMM) # needed for timeGetTime endif() -if(Qt5XmlPatterns_FOUND) +if(OGS_BUILD_GUI) target_link_libraries(BaseLib PUBLIC Qt5::Xml Qt5::XmlPatterns) - if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND) - target_link_libraries(BaseLib PUBLIC Qt5::Network ${OPENSSL_LIBRARIES} ws2_32) - endif() endif() if(OGS_USE_PCH) diff --git a/CMakeLists.txt b/CMakeLists.txt index 499a9d4658866459d0c2ed8d681f4e18bda8d91a..94b0a791e83bc4c37c08c1df0392ba48a4752040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ set(OGS_CONAN_BUILD "missing" CACHE STRING "Possible values: all, missing, \ # Third-party libraries, names come from Conan package names set(OGS_LIBS - VTK Boost Eigen3 Qt Shapelib libgeotiff petsc lis cvode + vtk boost eigen qt shapelib libgeotiff petsc lis cvode CACHE INTERNAL "") foreach(LIB ${OGS_LIBS}) set(OGS_LIB_${LIB} "Default" CACHE STRING "Which ${LIB} library should be used?") @@ -94,7 +94,7 @@ option(OGS_BUILD_CLI "Should the OGS simulator be built?" ON) option(OGS_BUILD_GUI "Should the Data Explorer be built?" OFF) if(OGS_BUILD_GUI) add_definitions(-DOGS_BUILD_GUI) - option(OGS_USE_NETCDF "Add NetCDF support." ON) + option(OGS_USE_NETCDF "Add NetCDF support." OFF) endif() option(OGS_BUILD_UTILS "Should the utilities programms be built?" OFF) if(OGS_BUILD_UTILS AND OGS_USE_MPI) diff --git a/GeoLib/CMakeLists.txt b/GeoLib/CMakeLists.txt index be49c05a839cbba9346f53d74ccdffd0ea3d431a..7c9fbf1599543793a1ca00db1111bb50db2b1712 100644 --- a/GeoLib/CMakeLists.txt +++ b/GeoLib/CMakeLists.txt @@ -6,7 +6,7 @@ APPEND_SOURCE_FILES(SOURCES IO) APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Rapid) APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Boost) -if(Qt5XmlPatterns_FOUND) +if(OGS_BUILD_GUI) APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Qt) endif() @@ -18,11 +18,8 @@ endif() target_link_libraries(GeoLib PUBLIC BaseLib MathLib logog PRIVATE tet) -if(Qt5XmlPatterns_FOUND) +if(OGS_BUILD_GUI) target_link_libraries(GeoLib PUBLIC Qt5::Xml Qt5::XmlPatterns) - if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND) - target_link_libraries(GeoLib PUBLIC Qt5::Network ${OPENSSL_LIBRARIES} ws2_32) - endif() endif() if(OGS_USE_PCH) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3e9721b0a9913409b7801e731c81fa0856f4c7a8..64a699d341dde6ca9ba7814c53acac9153d2f21a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -19,7 +19,7 @@ APPEND_SOURCE_FILES(TEST_SOURCES NumLib) APPEND_SOURCE_FILES(TEST_SOURCES ParameterLib) APPEND_SOURCE_FILES(TEST_SOURCES ProcessLib) -if(Qt5XmlPatterns_FOUND) +if(OGS_BUILD_GUI) APPEND_SOURCE_FILES(TEST_SOURCES FileIO_Qt) endif() @@ -71,13 +71,10 @@ if(OGS_INSITU) target_link_libraries(testrunner InSituLib) endif() -if(Qt5XmlPatterns_FOUND) +if(OGS_BUILD_GUI) target_link_libraries(testrunner Qt5::Core Qt5::Gui Qt5::Xml Qt5::Network VtkVis QtDataView) - if(CMAKE_CROSSCOMPILING) - target_link_libraries(testrunner - ${QT_XML_DEPS_LIBRARIES} - ${QT_GUI_DEPS_LIBRARIES} - ${QT_NETWORK_DEPS_LIBRARIES}) + if(GEOTIFF_FOUND) + target_link_libraries(testrunner ${GEOTIFF_LIBRARIES}) endif() endif() diff --git a/ThirdParty/cmake-modules b/ThirdParty/cmake-modules index 0068e164eb5ab1e16c931e50094846789b49cdc0..5893e3eb3aaec104f86ba81ee90b7e9279b74c3f 160000 --- a/ThirdParty/cmake-modules +++ b/ThirdParty/cmake-modules @@ -1 +1 @@ -Subproject commit 0068e164eb5ab1e16c931e50094846789b49cdc0 +Subproject commit 5893e3eb3aaec104f86ba81ee90b7e9279b74c3f diff --git a/scripts/cmake/ConanSetup.cmake b/scripts/cmake/ConanSetup.cmake index 0e1eb1080503c035cfee0e1782a056354b4f7cb3..d22c3660e92bfc8d2c567b49fb4c6061a0a10263 100644 --- a/scripts/cmake/ConanSetup.cmake +++ b/scripts/cmake/ConanSetup.cmake @@ -26,25 +26,24 @@ include(${PROJECT_SOURCE_DIR}/scripts/cmake/conan/conan.cmake) set(CONAN_REQUIRES boost/1.66.0@conan/stable - Eigen3/3.3.4@bilke/stable - VTK/8.1.1@bilke/stable + eigen/3.3.4@conan/stable + vtk/8.2.0@bilke/testing CACHE INTERNAL "" ) set(CONAN_OPTIONS boost:header_only=True - Qt:qtxmlpatterns=True - VTK:minimal=True - VTK:ioxml=True + vtk:minimal=True + vtk:ioxml=True CACHE INTERNAL "" ) if((UNIX AND NOT APPLE) AND BUILD_SHARED_LIBS) - set(CONAN_OPTIONS ${CONAN_OPTIONS} VTK:fPIC=True) + set(CONAN_OPTIONS ${CONAN_OPTIONS} vtk:fPIC=True) endif() if(OGS_USE_MPI) - set(CONAN_OPTIONS ${CONAN_OPTIONS} VTK:mpi_minimal=True) + set(CONAN_OPTIONS ${CONAN_OPTIONS} vtk:mpi_minimal=True) endif() if(OGS_USE_PETSC) @@ -64,17 +63,21 @@ endif() if(OGS_BUILD_GUI) set(CONAN_REQUIRES ${CONAN_REQUIRES} - Shapelib/1.3.0@bilke/stable + shapelib/1.3.0@bilke/stable libgeotiff/1.4.2@bilke/stable - Qt/5.11.2@bilke/stable - lzma/5.2.4@bincrafters/stable # 5.2.3 is not built for Xcode 10 + qt/5.11.3@bincrafters/stable ) set(CONAN_OPTIONS ${CONAN_OPTIONS} - VTK:minimal=False - VTK:qt=True + vtk:minimal=False + vtk:qt=True + qt:qtxmlpatterns=True ) endif() +if(OGS_USE_NETCDF) + set(CONAN_REQUIRES ${CONAN_REQUIRES} netcdf-cxx/4.3.1@bilke/testing) +endif() + conan_check(VERSION 1.3.0) message(STATUS "Third-party libraries:") diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index 62b62e5b49aa8a3cfe7ddbd85631a4861ee0e678..382f10411b8de0413143a934c7cfe9e557c9c519 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -54,16 +54,25 @@ if(NOT OGS_USE_CONAN OR NOT CONAN_CMD) include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) endif() -find_package(VTK 8.1.0 REQUIRED) +set(VTK_COMPONENTS vtkIOXML) +if(OGS_BUILD_GUI) + set(VTK_COMPONENTS ${VTK_COMPONENTS} + vtkIOImage vtkIOLegacy vtkIOExport vtkIOExportPDF + vtkIOExportOpenGL2 vtkInteractionStyle vtkInteractionWidgets + vtkGUISupportQt vtkRenderingOpenGL2 vtkRenderingContextOpenGL2 + vtkFiltersTexture vtkRenderingCore + ) +endif() +if(OGS_USE_MPI) + set(VTK_COMPONENTS ${VTK_COMPONENTS} vtkIOParallelXML vtkParallelMPI) +endif() +find_package(VTK 8.2.0 REQUIRED COMPONENTS ${VTK_COMPONENTS}) include(${VTK_USE_FILE}) find_package(Eigen3 3.3.4 REQUIRED) include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR}) ## pthread, is a requirement of logog ## -if(CMAKE_CROSSCOMPILING) - set(THREADS_PTHREAD_ARG 0 CACHE STRING "Result from TRY_RUN" FORCE) -endif() set(CMAKE_THREAD_PREFER_PTHREAD ON) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) @@ -94,15 +103,12 @@ if(OGS_BUILD_GUI) endif() find_package(Qt5 5.2 REQUIRED ${QT_MODULES}) cmake_policy(SET CMP0020 NEW) - if(CMAKE_CROSSCOMPILING) - find_package(PkgConfig REQUIRED) - 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() + +if(OGS_USE_NETCDF) + set(NETCDF_ROOT ${CONAN_NETCDF-C_ROOT}) + set(NETCDF_CXX_ROOT ${CONAN_NETCDF-CXX_ROOT}) + find_package(NetCDF REQUIRED) endif() # lapack diff --git a/scripts/cmake/packaging/PackagingWin.cmake b/scripts/cmake/packaging/PackagingWin.cmake index 48ea5fdbeb8b85c4270285c3dff3a3837e91cdad..d6efd12dd2b8ef281e14f2e6a4343a322493aab2 100644 --- a/scripts/cmake/packaging/PackagingWin.cmake +++ b/scripts/cmake/packaging/PackagingWin.cmake @@ -2,9 +2,6 @@ set(CMAKE_INSTALL_UCRT_LIBRARIES ON) set(CMAKE_INSTALL_OPENMP_LIBRARIES ON) include(InstallRequiredSystemLibraries) set(CPACK_GENERATOR ZIP) -#if(NOT CMAKE_CROSSCOMPILING) -# set(CPACK_GENERATOR NSIS ZIP) -#endif() set(CPACK_NSIS_MUI_ICON ${PROJECT_SOURCE_DIR}/scripts/packaging/ogs-de-icon.ico) set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/Documentation/OpenGeoSys-Logo.bmp) set(CPACK_NSIS_INSTALLED_ICON_NAME ${CPACK_NSIS_MUI_ICON}) diff --git a/scripts/docker/Dockerfile.clang.full b/scripts/docker/Dockerfile.clang.full index bb717036bd4c4b296771f5e10ba22f6d3d925cba..6268af2eb122d3f454fcc6d3f0e74a50f4dfd07a 100644 --- a/scripts/docker/Dockerfile.clang.full +++ b/scripts/docker/Dockerfile.clang.full @@ -73,12 +73,12 @@ RUN apt-get update -y && \ python3-setuptools \ python3-wheel && \ rm -rf /var/lib/apt/lists/* -RUN pip3 install conan==1.16.0 +RUN pip3 install conan==1.17.0 RUN mkdir -p /opt/conan && \ chmod 777 /opt/conan ENV CONAN_USER_HOME=/opt/conan LABEL org.opengeosys.pm=conan \ - org.opengeosys.pm.conan.version=1.16.0 + org.opengeosys.pm.conan.version=1.17.0 LABEL org.opengeosys.pm.conan.user_home=/opt/conan # Include-what-you-use for clang version 7 diff --git a/scripts/docker/Dockerfile.gcc.full b/scripts/docker/Dockerfile.gcc.full index 265e52383a768bc55037adb45de85205010f27d9..52b786901d6682842f118d48c725b65c7a8fc46b 100644 --- a/scripts/docker/Dockerfile.gcc.full +++ b/scripts/docker/Dockerfile.gcc.full @@ -66,12 +66,12 @@ RUN apt-get update -y && \ python3-setuptools \ python3-wheel && \ rm -rf /var/lib/apt/lists/* -RUN pip3 install conan==1.16.0 +RUN pip3 install conan==1.17.0 RUN mkdir -p /opt/conan && \ chmod 777 /opt/conan ENV CONAN_USER_HOME=/opt/conan LABEL org.opengeosys.pm=conan \ - org.opengeosys.pm.conan.version=1.16.0 + org.opengeosys.pm.conan.version=1.17.0 LABEL org.opengeosys.pm.conan.user_home=/opt/conan # cppcheck version 1.87 diff --git a/scripts/docker/Dockerfile.gcc.gui b/scripts/docker/Dockerfile.gcc.gui index aff24b2d470b351805c820cce0a02a03bb2884b6..dcc34b8ebb82a18731cbb072d49aa8b659b4f86c 100644 --- a/scripts/docker/Dockerfile.gcc.gui +++ b/scripts/docker/Dockerfile.gcc.gui @@ -61,6 +61,7 @@ RUN apt-get update && \ RUN apt-get update -y && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ libgl1-mesa-dev \ + libglu1-mesa-dev \ libxt-dev \ mesa-common-dev && \ rm -rf /var/lib/apt/lists/* @@ -73,12 +74,12 @@ RUN apt-get update -y && \ python3-setuptools \ python3-wheel && \ rm -rf /var/lib/apt/lists/* -RUN pip3 install conan==1.16.0 +RUN pip3 install conan==1.17.0 RUN mkdir -p /opt/conan && \ chmod 777 /opt/conan ENV CONAN_USER_HOME=/opt/conan LABEL org.opengeosys.pm=conan \ - org.opengeosys.pm.conan.version=1.16.0 + org.opengeosys.pm.conan.version=1.17.0 LABEL org.opengeosys.pm.conan.user_home=/opt/conan # cppcheck version 1.87