From: rnv Date: Fri, 31 May 2019 09:05:17 +0000 (+0300) Subject: Remove QT4 compatibility: additional changes. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Frnv%2Fremove_qt4compat;p=modules%2Fgui.git Remove QT4 compatibility: additional changes. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 874bd0835..c70185f65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,7 +72,6 @@ SET(BUILD_SHARED_LIBS TRUE) OPTION(SALOME_BUILD_DOC "Generate SALOME GUI documentation" ON) OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) OPTION(SALOME_GUI_USE_OBSERVERS "Use study observers in GUI (advanced)" ON) -OPTION(SALOME_BUILD_WITH_QT5 "Build SALOME with Qt 5" ON) CMAKE_DEPENDENT_OPTION(SALOME_GUI_BUILD_FRENCH_DOC "Generate SALOME GUI French documentation" OFF "SALOME_BUILD_DOC" OFF) @@ -160,31 +159,20 @@ IF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER) ENDIF() # Qt -IF(NOT SALOME_BUILD_WITH_QT5) - FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL QtNetwork) - ADD_DEFINITIONS("-DUSE_SALOME_STYLE") - SET(QT_SALOME_VERSION 4) - SET(SALOME_GUI_ENABLE_QTXWEBBROWSER TRUE) -ELSE() - FIND_PACKAGE(SalomeQt5 REQUIRED) - SET(QT_SALOME_VERSION 5) - SET(SALOME_GUI_ENABLE_QTXWEBBROWSER TRUE) - IF(NOT "${QT_VERSION}" VERSION_LESS "5.6.0") - # Check that WebEngineWidgets component was found - IF(NOT Qt5WebEngineWidgets_FOUND) - SET(SALOME_GUI_ENABLE_QTXWEBBROWSER FALSE) - ADD_DEFINITIONS("-DDISABLE_QTXWEBBROWSER") - MESSAGE("Qt5WebEngineWidgets is not found, SALOME internal help browser will be unavailable !") - ENDIF() +FIND_PACKAGE(SalomeQt5 REQUIRED) +SET(QT_SALOME_VERSION 5) +SET(SALOME_GUI_ENABLE_QTXWEBBROWSER TRUE) +IF(NOT "${QT_VERSION}" VERSION_LESS "5.6.0") + # Check that WebEngineWidgets component was found + IF(NOT Qt5WebEngineWidgets_FOUND) + SET(SALOME_GUI_ENABLE_QTXWEBBROWSER FALSE) + ADD_DEFINITIONS("-DDISABLE_QTXWEBBROWSER") + MESSAGE("Qt5WebEngineWidgets is not found, SALOME internal help browser will be unavailable !") ENDIF() ENDIF() # PyQt -IF (NOT SALOME_BUILD_WITH_QT5) - FIND_PACKAGE(SalomePyQt4 REQUIRED) -ELSE() - FIND_PACKAGE(SalomePyQt5 REQUIRED) -ENDIF() +FIND_PACKAGE(SalomePyQt5 REQUIRED) # Optional packages for GUI and their pre-requisites @@ -439,13 +427,9 @@ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets} # Ensure the variables are always defined for the configure: SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}") SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}") -IF(NOT SALOME_BUILD_WITH_QT5) - SET(QT_ROOT_DIR "${QT4_ROOT_DIR}") - SET(PYQT_ROOT_DIR "${PYQT4_ROOT_DIR}") -ELSE() - SET(QT_ROOT_DIR "${QT5_ROOT_DIR}") - SET(PYQT_ROOT_DIR "${PYQT5_ROOT_DIR}") -ENDIF() +SET(QT_ROOT_DIR "${QT5_ROOT_DIR}") +SET(PYQT_ROOT_DIR "${PYQT5_ROOT_DIR}") + SET(OPENCASCADE_ROOT_DIR "${OPENCASCADE_ROOT_DIR}") SET(OPENGL_ROOT_DIR "${OPENGL_ROOT_DIR}") SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}") @@ -454,11 +438,7 @@ SET(QWT_ROOT_DIR "${QWT_ROOT_DIR}") SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") # Build variables that will be expanded when configuring SalomeConfig.cmake: -IF(NOT SALOME_BUILD_WITH_QT5) - SALOME_CONFIGURE_PREPARE(OpenCASCADE OpenGL Qt4 PyQt4 Qwt SIP VTK) -ELSE() - SALOME_CONFIGURE_PREPARE(OpenCASCADE OpenGL Qt5 PyQt5 Qwt SIP VTK) -ENDIF() +SALOME_CONFIGURE_PREPARE(OpenCASCADE OpenGL Qt5 PyQt5 Qwt SIP VTK) CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake diff --git a/SalomeGUIConfig.cmake.in b/SalomeGUIConfig.cmake.in index a47667865..08492ef2f 100644 --- a/SalomeGUIConfig.cmake.in +++ b/SalomeGUIConfig.cmake.in @@ -50,7 +50,6 @@ SET(GUI_DEFINITIONS "@KERNEL_DEFINITIONS@") SET(SALOME_GUI_BUILD_DOC @SALOME_BUILD_DOC@) SET(SALOME_GUI_BUILD_TESTS @SALOME_BUILD_TESTS@) SET(SALOME_GUI_LIGHT_ONLY @SALOME_LIGHT_ONLY@) -SET(SALOME_GUI_BUILD_WITH_QT5 @SALOME_BUILD_WITH_QT5@) # Advanced options SET(SALOME_USE_OCCVIEWER @SALOME_USE_OCCVIEWER@) @@ -111,13 +110,8 @@ ENDIF() # Level 1 prerequisites: SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@") SET_AND_CHECK(SIP_ROOT_DIR_EXP "@PACKAGE_SIP_ROOT_DIR@") -IF(NOT SALOME_GUI_BUILD_WITH_QT5) - SET_AND_CHECK(QT4_ROOT_DIR_EXP "@PACKAGE_QT_ROOT_DIR@") - SET_AND_CHECK(PYQT4_ROOT_DIR_EXP "@PACKAGE_PYQT_ROOT_DIR@") -ELSE() - SET_AND_CHECK(QT5_ROOT_DIR_EXP "@PACKAGE_QT_ROOT_DIR@") - SET_AND_CHECK(PYQT5_ROOT_DIR_EXP "@PACKAGE_PYQT_ROOT_DIR@") -ENDIF() +SET_AND_CHECK(QT5_ROOT_DIR_EXP "@PACKAGE_QT_ROOT_DIR@") +SET_AND_CHECK(PYQT5_ROOT_DIR_EXP "@PACKAGE_PYQT_ROOT_DIR@") SET_AND_CHECK(OPENCASCADE_ROOT_DIR_EXP "@PACKAGE_OPENCASCADE_ROOT_DIR@") # Optional level 1 prerequisites: diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index 0b97d4bf0..b2dc37dac 100644 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -2106,7 +2106,6 @@ long Qtx::versionToId( const QString& version ) The function tries to detect qt installation directory by analyzing the system variables in the following order: - QT5_ROOT_DIR - - QT4_ROOT_DIR - QT_ROOT_DIR - QTDIR @@ -2119,7 +2118,7 @@ long Qtx::versionToId( const QString& version ) QString Qtx::qtDir( const QString& context ) { - QStringList vars = { "QT5_ROOT_DIR", "QT4_ROOT_DIR", "QT_ROOT_DIR", "QTDIR" }; + QStringList vars = { "QT5_ROOT_DIR", "QT_ROOT_DIR", "QTDIR" }; QString qtPath; for (uint i = 0; i < vars.length() && qtPath.isEmpty(); i++ ) { qtPath = getenv(vars[i]); diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index b64d4fd34..502ff86c2 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -29,7 +29,6 @@ IF(SALOME_USE_PYCONSOLE) SET(PYCONSOLE_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "") SET(PYCONSOLE_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "") SET(PYCONSOLE_INSTALL_RES "${SALOME_GUI_INSTALL_RES_DATA}" CACHE PATH "") - OPTION(PYCONSOLE_BUILD_WITH_QT5 "Build PyConsole with Qt 5" ${SALOME_BUILD_WITH_QT5}) ADD_SUBDIRECTORY(../tools/PyConsole) # will bring in PyInterp automatically ENDIF(SALOME_USE_PYCONSOLE) @@ -41,7 +40,6 @@ IF(SALOME_USE_PYVIEWER) SET(PYEDITOR_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "") SET(PYEDITOR_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "") SET(PYEDITOR_INSTALL_RES "${SALOME_GUI_INSTALL_RES_DATA}" CACHE PATH "") - OPTION(PYEDITOR_BUILD_WITH_QT5 "Build PyEditor with Qt 5" ${SALOME_BUILD_WITH_QT5}) ADD_SUBDIRECTORY(PyEditor) ENDIF(SALOME_USE_PYVIEWER) diff --git a/tools/PyConsole/CMakeLists.txt b/tools/PyConsole/CMakeLists.txt index 2e639d297..829884192 100644 --- a/tools/PyConsole/CMakeLists.txt +++ b/tools/PyConsole/CMakeLists.txt @@ -44,7 +44,6 @@ INCLUDE(SalomeSetupPlatform) # Options # ======= -OPTION(PYCONSOLE_BUILD_WITH_QT5 "Build PYCONSOLE with Qt 5" ON) OPTION(PYCONSOLE_BUILD_PYTHON "Build Python wrapping for PyConsole" ON) # @@ -55,24 +54,14 @@ FIND_PACKAGE(SalomePythonInterp REQUIRED) FIND_PACKAGE(SalomePythonLibs REQUIRED) # Qt -IF(NOT PYCONSOLE_BUILD_WITH_QT5) - FIND_PACKAGE(SalomeQt4 REQUIRED) -ELSE() - FIND_PACKAGE(SalomeQt5 REQUIRED) -ENDIF() - +FIND_PACKAGE(SalomeQt5 REQUIRED) IF(PYCONSOLE_BUILD_PYTHON) # Sip FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt SALOME_LOG_OPTIONAL_PACKAGE(SalomeSIP PYCONSOLE_BUILD_PYTHON) # PyQt - IF (NOT PYCONSOLE_BUILD_WITH_QT5) - FIND_PACKAGE(SalomePyQt4 REQUIRED) - SALOME_LOG_OPTIONAL_PACKAGE(SalomePyQt4 PYCONSOLE_BUILD_PYTHON) - ELSE() - FIND_PACKAGE(SalomePyQt5 REQUIRED) - SALOME_LOG_OPTIONAL_PACKAGE(SalomePyQt5 PYCONSOLE_BUILD_PYTHON) - ENDIF() + FIND_PACKAGE(SalomePyQt5 REQUIRED) + SALOME_LOG_OPTIONAL_PACKAGE(SalomePyQt5 PYCONSOLE_BUILD_PYTHON) ENDIF(PYCONSOLE_BUILD_PYTHON) # Detection report @@ -94,7 +83,6 @@ SET(PYCONSOLE_INSTALL_RES share/resources CACHE PATH "Install path: PyConsole re SET(PYINTERP_INSTALL_LIBS "${PYCONSOLE_INSTALL_LIBS}" CACHE PATH "") SET(PYINTERP_INSTALL_HEADERS "${PYCONSOLE_INSTALL_HEADERS}" CACHE PATH "") SET(PYINTERP_INSTALL_RES "${PYCONSOLE_INSTALL_RES}" CACHE PATH "") -OPTION(PYINTERP_BUILD_WITH_QT5 "Build PYCONSOLE with Qt 5" ${PYCONSOLE_BUILD_WITH_QT5}) ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/../PyInterp ${PROJECT_BINARY_DIR}/PyInterp) INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/../PyInterp/src) diff --git a/tools/PyEditor/CMakeLists.txt b/tools/PyEditor/CMakeLists.txt index 92b14f6cb..414c8ea80 100644 --- a/tools/PyEditor/CMakeLists.txt +++ b/tools/PyEditor/CMakeLists.txt @@ -44,7 +44,6 @@ INCLUDE(SalomeSetupPlatform) # Options # ======= -OPTION(PYEDITOR_BUILD_WITH_QT5 "Build PyEditor with Qt 5" ON) OPTION(PYEDITOR_BUILD_SHARED_LIBS "Build shared libraries for PyEditor" ON) OPTION(PYEDITOR_BUILD_EXE "Build PyEditor's executable" ON) OPTION(PYEDITOR_BUILD_PYTHON "Build Python wrapping for PyEditor" ON) @@ -60,12 +59,7 @@ ELSE(PYEDITOR_BUILD_SHARED_LIBS) ENDIF(PYEDITOR_BUILD_SHARED_LIBS) # Qt -IF(NOT PYEDITOR_BUILD_WITH_QT5) - FIND_PACKAGE(SalomeQt4 REQUIRED) -ELSE() - FIND_PACKAGE(SalomeQt5 REQUIRED) -ENDIF() - +FIND_PACKAGE(SalomeQt5 REQUIRED) IF(PYEDITOR_BUILD_PYTHON) # Python FIND_PACKAGE(SalomePythonInterp REQUIRED) @@ -76,13 +70,8 @@ IF(PYEDITOR_BUILD_PYTHON) FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt SALOME_LOG_OPTIONAL_PACKAGE(SalomeSIP PYEDITOR_BUILD_PYTHON) # PyQt - IF (NOT PYEDITOR_BUILD_WITH_QT5) - FIND_PACKAGE(SalomePyQt4 REQUIRED) - SALOME_LOG_OPTIONAL_PACKAGE(SalomePyQt4 PYEDITOR_BUILD_PYTHON) - ELSE() - FIND_PACKAGE(SalomePyQt5 REQUIRED) - SALOME_LOG_OPTIONAL_PACKAGE(SalomePyQt5 PYEDITOR_BUILD_PYTHON) - ENDIF() + FIND_PACKAGE(SalomePyQt5 REQUIRED) + SALOME_LOG_OPTIONAL_PACKAGE(SalomePyQt5 PYEDITOR_BUILD_PYTHON) ENDIF(PYEDITOR_BUILD_PYTHON) # Detection report diff --git a/tools/PyInterp/CMakeLists.txt b/tools/PyInterp/CMakeLists.txt index 45131eaef..2b5da6adb 100644 --- a/tools/PyInterp/CMakeLists.txt +++ b/tools/PyInterp/CMakeLists.txt @@ -44,7 +44,6 @@ INCLUDE(SalomeSetupPlatform) # Options # ======= -OPTION(PYINTERP_BUILD_WITH_QT5 "Build PYINTERP with Qt 5" ON) # # Set list of prerequisites @@ -53,11 +52,7 @@ OPTION(PYINTERP_BUILD_WITH_QT5 "Build PYINTERP with Qt 5" ON) FIND_PACKAGE(SalomePythonInterp REQUIRED) FIND_PACKAGE(SalomePythonLibs REQUIRED) # Qt -IF(NOT PYINTERP_BUILD_WITH_QT5) - FIND_PACKAGE(SalomeQt4 REQUIRED) -ELSE() - FIND_PACKAGE(SalomeQt5 REQUIRED) -ENDIF() +FIND_PACKAGE(SalomeQt5 REQUIRED) # Detection report SALOME_PACKAGE_REPORT_AND_CHECK()