From 01a66ae8a1886d1f13216fc712d7c8cdd91484bb Mon Sep 17 00:00:00 2001 From: abn Date: Mon, 23 May 2016 09:54:31 +0200 Subject: [PATCH] PyConsole/PyInterp: possibility to build with or w/o Qt5 --- src/CMakeLists.txt | 9 +-------- tools/CMakeLists.txt | 15 +++++++++++++++ tools/PyConsole/CMakeLists.txt | 13 ++++++++++++- tools/PyInterp/CMakeLists.txt | 11 ++++++++++- 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 05ef01bc8..9d4490662 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -118,21 +118,14 @@ IF(SALOME_USE_PYVIEWER) ADD_SUBDIRECTORY(PyViewer) ENDIF(SALOME_USE_PYVIEWER) - ## # Python-based packages, part 1 (generic) ## IF(SALOME_USE_PYCONSOLE) - # Include sub-project PyConsole: - SET(TOOLS_EXPORT_NAME ${PROJECT_NAME}) - SET(PYCONSOLE_INSTALL_LIBS "${SALOME_INSTALL_LIBS}") - SET(PYCONSOLE_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}") - SET(PYCONSOLE_INSTALL_RES "${SALOME_GUI_INSTALL_RES_DATA}") - ADD_SUBDIRECTORY(../tools/PyConsole ${CMAKE_CURRENT_BINARY_DIR}/PyConsole) # will bring in PyInterp automatically - ADD_SUBDIRECTORY(SALOME_PYQT) ENDIF(SALOME_USE_PYCONSOLE) + ## # Light SALOME packages ## diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index f038c35b9..1ca8dc33b 100755 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -22,3 +22,18 @@ ADD_SUBDIRECTORY(dlgfactory) IF(SALOME_USE_VTKVIEWER) ADD_SUBDIRECTORY(vtkEDFOverloads) ENDIF() + +## +# Python-based packages, part 1 (generic) +## +IF(SALOME_USE_PYCONSOLE) + # Include sub-project PyConsole: + SET(TOOLS_EXPORT_NAME ${PROJECT_NAME}) + SET(PYCONSOLE_INSTALL_LIBS "${SALOME_INSTALL_LIBS}") + SET(PYCONSOLE_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}") + SET(PYCONSOLE_INSTALL_RES "${SALOME_GUI_INSTALL_RES_DATA}") + 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) + diff --git a/tools/PyConsole/CMakeLists.txt b/tools/PyConsole/CMakeLists.txt index a2ce72f13..136b81e9b 100644 --- a/tools/PyConsole/CMakeLists.txt +++ b/tools/PyConsole/CMakeLists.txt @@ -42,13 +42,23 @@ LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../adm_local/cmake_files # ============== INCLUDE(SalomeSetupPlatform) +# Options +# ======= +OPTION(PYCONSOLE_BUILD_WITH_QT5 "Build PYCONSOLE with Qt 5" ON) + # # Set list of prerequisites # ========================= FIND_PACKAGE(SalomePythonInterp REQUIRED) FIND_PACKAGE(SalomePythonLibs REQUIRED) -FIND_PACKAGE(SalomeQt4 REQUIRED) + +# Qt +IF(NOT PYCONSOLE_BUILD_WITH_QT5) + FIND_PACKAGE(SalomeQt4 REQUIRED) +ELSE() + FIND_PACKAGE(SalomeQt5 REQUIRED) +ENDIF() # Detection report SALOME_PACKAGE_REPORT_AND_CHECK() @@ -69,6 +79,7 @@ SET(PYCONSOLE_INSTALL_RES share/resources CACHE PATH "Install path: PyConsole re SET(PYINTERP_INSTALL_LIBS "${PYCONSOLE_INSTALL_LIBS}") SET(PYINTERP_INSTALL_HEADERS "${PYCONSOLE_INSTALL_HEADERS}") SET(PYINTERP_INSTALL_RES "${PYCONSOLE_INSTALL_RES}") +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/PyInterp/CMakeLists.txt b/tools/PyInterp/CMakeLists.txt index 6b245059a..40c20ba81 100644 --- a/tools/PyInterp/CMakeLists.txt +++ b/tools/PyInterp/CMakeLists.txt @@ -42,13 +42,22 @@ LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../adm_local/cmake_files # ============== INCLUDE(SalomeSetupPlatform) +# Options +# ======= +OPTION(PYINTERP_BUILD_WITH_QT5 "Build PYINTERP with Qt 5" ON) + # # Set list of prerequisites # ========================= FIND_PACKAGE(SalomePythonInterp REQUIRED) FIND_PACKAGE(SalomePythonLibs REQUIRED) -FIND_PACKAGE(SalomeQt4 REQUIRED) +# Qt +IF(NOT PYINTERP_BUILD_WITH_QT5) + FIND_PACKAGE(SalomeQt4 REQUIRED) +ELSE() + FIND_PACKAGE(SalomeQt5 REQUIRED) +ENDIF() # Detection report SALOME_PACKAGE_REPORT_AND_CHECK() -- 2.39.2