Skip to content

Commit

Permalink
Merge pull request #2450 from bilke/conan-qt
Browse files Browse the repository at this point in the history
[Conan] Use lower-case packages
  • Loading branch information
bilke committed Jul 12, 2019
2 parents 0bc8662 + 25e1626 commit bb478a6
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 72 deletions.
10 changes: 0 additions & 10 deletions Applications/DataExplorer/DataExplorer.cmake
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
4 changes: 0 additions & 4 deletions Applications/DataExplorer/VtkVis/CMakeLists.txt
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Applications/FileIO/CMakeLists.txt
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions 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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Applications/Utils/GeoTools/CMakeLists.txt
@@ -1,4 +1,4 @@
if(NOT Qt5XmlPatterns_FOUND)
if(NOT OGS_BUILD_GUI)
return()
endif()

Expand Down
7 changes: 2 additions & 5 deletions BaseLib/CMakeLists.txt
Expand Up @@ -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()

Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -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?")
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions GeoLib/CMakeLists.txt
Expand Up @@ -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()

Expand All @@ -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)
Expand Down
11 changes: 4 additions & 7 deletions Tests/CMakeLists.txt
Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/cmake-modules
Submodule cmake-modules updated 1 files
+27 −0 FindNetCDF.cmake
27 changes: 15 additions & 12 deletions scripts/cmake/ConanSetup.cmake
Expand Up @@ -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)
Expand All @@ -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:")
Expand Down
32 changes: 19 additions & 13 deletions scripts/cmake/Find.cmake
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions scripts/cmake/packaging/PackagingWin.cmake
Expand Up @@ -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})
Expand Down
4 changes: 2 additions & 2 deletions scripts/docker/Dockerfile.clang.full
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/docker/Dockerfile.gcc.full
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions scripts/docker/Dockerfile.gcc.gui
Expand Up @@ -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/*
Expand All @@ -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
Expand Down

0 comments on commit bb478a6

Please sign in to comment.