]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Remove QT4 compatibility: additional changes. rnv/remove_qt4compat
authorrnv <rnv@opencascade.com>
Fri, 31 May 2019 09:05:17 +0000 (12:05 +0300)
committerrnv <rnv@opencascade.com>
Fri, 31 May 2019 09:05:17 +0000 (12:05 +0300)
CMakeLists.txt
SalomeGUIConfig.cmake.in
src/Qtx/Qtx.cxx
tools/CMakeLists.txt
tools/PyConsole/CMakeLists.txt
tools/PyEditor/CMakeLists.txt
tools/PyInterp/CMakeLists.txt

index 874bd0835f1295298f4f09a2b9caed19c24f5e49..c70185f6519e9c1bff211bddd8b456a52dc9ad65 100644 (file)
@@ -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 Salome<MODULE>Config.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
index a47667865fe27fa42d707d427d402e67f2375afd..08492ef2f8225d9728d418e57980baba2625c162 100644 (file)
@@ -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:
index 0b97d4bf01a5ea7e81097d8c8a759dc4d2b4b5a1..b2dc37dac141c18df705d9e97c0579cfada80bd5 100644 (file)
@@ -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]);
index b64d4fd34be386b936f7faff4de3a04f7a2d34b2..502ff86c23b677990fce105b2690545439baf4a6 100644 (file)
@@ -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)
 
index 2e639d297488207eb139b7faba7b33954f96203d..829884192805506584798f02e258d680f3dacfcb 100644 (file)
@@ -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)
index 92b14f6cb25c1f113befaab582b1c4817209d659..414c8ea801a1fbf94c2e272d7aa3f133ff7805e1 100644 (file)
@@ -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
index 45131eaeff0103000354dd112c1a89e300cacb8a..2b5da6adb872be8183d2c7b9e03469ae89bde6d0 100644 (file)
@@ -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()