From: vsr Date: Thu, 19 Nov 2015 10:35:10 +0000 (+0300) Subject: Correctly check ParaView (depending on Qt version) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=126f608ec54d987480ecf46a8fa3d80b762bcc68;p=modules%2Fgui.git Correctly check ParaView (depending on Qt version) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 175ad8ca1..d59f610a6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,9 +184,6 @@ ELSE() ADD_DEFINITIONS("-DDISABLE_PLOT2DVIEWER") ENDIF() IF (SALOME_USE_PVVIEWER) - IF(SALOME_BUILD_WITH_QT5) - SET(PARAVIEW_QT_VERSION "5") - ENDIF() FIND_PACKAGE(SalomeParaView) SALOME_LOG_OPTIONAL_PACKAGE(ParaView SALOME_USE_PVVIEWER) ELSE() diff --git a/adm_local/cmake_files/FindSalomeParaView.cmake b/adm_local/cmake_files/FindSalomeParaView.cmake index 4363516ba..08c01ebc7 100644 --- a/adm_local/cmake_files/FindSalomeParaView.cmake +++ b/adm_local/cmake_files/FindSalomeParaView.cmake @@ -19,12 +19,21 @@ # Author: Adrien Bruneton # -# Graphviz detection for salome +# ParaView detection for salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # +IF(NOT QT_VERSION) + MESSAGE(FATAL_ERROR "Detection of ParaView requires Qt to be detected first!") +ENDIF() + +IF (QT_VERSION VERSION_LESS "5.0") + SET(PARAVIEW_QT_VERSION "4") +ELSE() + SET(PARAVIEW_QT_VERSION "5") +ENDIF() + SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(ParaView PARAVIEW_USE_FILE 4) -#MARK_AS_ADVANCED() INCLUDE(${PARAVIEW_USE_FILE}) diff --git a/adm_local/cmake_files/FindSalomeQt4.cmake b/adm_local/cmake_files/FindSalomeQt4.cmake index a89fc81a8..f0cad8cae 100644 --- a/adm_local/cmake_files/FindSalomeQt4.cmake +++ b/adm_local/cmake_files/FindSalomeQt4.cmake @@ -30,4 +30,6 @@ IF(QT4_FOUND) SALOME_ACCUMULATE_HEADERS(QT_INCLUDES) SALOME_ACCUMULATE_ENVIRONMENT(PATH ${QT_QMAKE_EXECUTABLE}) SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QT_QTCORE_LIBRARY}) + SET(QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}") + MESSAGE(STATUS "Qt version is ${QT_VERSION}") ENDIF() diff --git a/adm_local/cmake_files/FindSalomeQt5.cmake b/adm_local/cmake_files/FindSalomeQt5.cmake index 04fc9f7fa..27884f129 100644 --- a/adm_local/cmake_files/FindSalomeQt5.cmake +++ b/adm_local/cmake_files/FindSalomeQt5.cmake @@ -24,16 +24,16 @@ # !! Please read the generic detection procedure in SalomeMacros.cmake !! # -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Core Qt5Core_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Gui Qt5Gui_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Widgets Qt5Widgets_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Network Qt5Network_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Xml Qt5Xml_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5OpenGL Qt5OpenGL_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5PrintSupport Qt5PrintSupport_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5WebKit Qt5WebKit_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Core Qt5Core_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Gui Qt5Gui_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Widgets Qt5Widgets_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Network Qt5Network_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Xml Qt5Xml_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5OpenGL Qt5OpenGL_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5PrintSupport Qt5PrintSupport_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5WebKit Qt5WebKit_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5WebKitWidgets Qt5WebKitWidgets_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5X11Extras Qt5X11Extras_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5X11Extras Qt5X11Extras_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR) get_filename_component(LINGUIST_PATH ${Qt5Core_DIR} DIRECTORY) get_filename_component(LINGUIST_PATH ${LINGUIST_PATH} DIRECTORY) @@ -61,8 +61,10 @@ endif(QT_LRELEASE_EXECUTABLE) #MARK_AS_ADVANCED(QT_QMAKE_EXECUTABLE) # -#IF(QT5_FOUND) +IF(Qt5Core_FOUND) # SALOME_ACCUMULATE_HEADERS(QT_INCLUDES) # SALOME_ACCUMULATE_ENVIRONMENT(PATH ${QT_QMAKE_EXECUTABLE}) # SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QT_QTCORE_LIBRARY}) -#ENDIF() + SET(QT_VERSION "${Qt5Core_VERSION}") + MESSAGE(STATUS "Qt version is ${QT_VERSION}") +ENDIF()