# 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})
# !! 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)
#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()