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)
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
# 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}")
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
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@)
# 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:
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
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]);
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)
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)
# Options
# =======
-OPTION(PYCONSOLE_BUILD_WITH_QT5 "Build PYCONSOLE with Qt 5" ON)
OPTION(PYCONSOLE_BUILD_PYTHON "Build Python wrapping for PyConsole" ON)
#
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
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)
# 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)
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)
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
# Options
# =======
-OPTION(PYINTERP_BUILD_WITH_QT5 "Build PYINTERP with Qt 5" ON)
#
# Set list of prerequisites
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()