From cb00147d363db68c5cefe98d1615be8f49af1772 Mon Sep 17 00:00:00 2001 From: abn Date: Fri, 20 May 2016 14:51:16 +0200 Subject: [PATCH] Modifying build procedure to expose PyConsole and PyInterp as tools. --- src/CMakeLists.txt | 6 +- src/LightApp/CMakeLists.txt | 4 +- src/PVServerService/CMakeLists.txt | 2 +- .../SALOME_PYQT_GUI/CMakeLists.txt | 3 +- .../SALOME_PYQT_GUILight/CMakeLists.txt | 4 +- src/SALOME_PYQT/SalomePyQt/CMakeLists.txt | 4 +- src/SalomeApp/CMakeLists.txt | 4 +- tools/CMakeLists.txt | 15 ++++ tools/PyConsole/CMakeLists.txt | 90 +++++++++++++++++++ .../PyConsole/src}/CMakeLists.txt | 6 +- .../PyConsole/src}/PyConsole.h | 0 .../PyConsole/src}/PyConsole_Console.cxx | 0 .../PyConsole/src}/PyConsole_Console.h | 0 .../PyConsole/src}/PyConsole_Editor.cxx | 0 .../PyConsole/src}/PyConsole_Editor.h | 0 .../PyConsole/src}/PyConsole_Event.cxx | 0 .../PyConsole/src}/PyConsole_Event.h | 0 .../PyConsole/src}/PyConsole_Interp.cxx | 0 .../PyConsole/src}/PyConsole_Interp.h | 0 .../PyConsole/src}/PyConsole_Request.cxx | 0 .../PyConsole/src}/PyConsole_Request.h | 0 .../src}/resources/PyConsole_msg_en.ts | 0 .../src}/resources/PyConsole_msg_fr.ts | 0 .../src}/resources/PyConsole_msg_ja.ts | 0 tools/PyInterp/CMakeLists.txt | 78 ++++++++++++++++ .../PyInterp/src}/CMakeLists.txt | 4 +- .../PyInterp/src}/PyInterp.h | 0 .../PyInterp/src}/PyInterp_Dispatcher.cxx | 0 .../PyInterp/src}/PyInterp_Dispatcher.h | 0 .../PyInterp/src}/PyInterp_Event.cxx | 0 .../PyInterp/src}/PyInterp_Event.h | 0 .../PyInterp/src}/PyInterp_Interp.cxx | 0 .../PyInterp/src}/PyInterp_Interp.h | 0 .../PyInterp/src}/PyInterp_Request.cxx | 0 .../PyInterp/src}/PyInterp_Request.h | 0 .../PyInterp/src}/PyInterp_Utils.h | 0 36 files changed, 200 insertions(+), 20 deletions(-) create mode 100644 tools/PyConsole/CMakeLists.txt rename {src/PyConsole => tools/PyConsole/src}/CMakeLists.txt (89%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole.h (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Console.cxx (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Console.h (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Editor.cxx (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Editor.h (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Event.cxx (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Event.h (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Interp.cxx (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Interp.h (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Request.cxx (100%) rename {src/PyConsole => tools/PyConsole/src}/PyConsole_Request.h (100%) rename {src/PyConsole => tools/PyConsole/src}/resources/PyConsole_msg_en.ts (100%) rename {src/PyConsole => tools/PyConsole/src}/resources/PyConsole_msg_fr.ts (100%) rename {src/PyConsole => tools/PyConsole/src}/resources/PyConsole_msg_ja.ts (100%) create mode 100644 tools/PyInterp/CMakeLists.txt rename {src/PyInterp => tools/PyInterp/src}/CMakeLists.txt (91%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp.h (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Dispatcher.cxx (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Dispatcher.h (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Event.cxx (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Event.h (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Interp.cxx (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Interp.h (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Request.cxx (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Request.h (100%) rename {src/PyInterp => tools/PyInterp/src}/PyInterp_Utils.h (100%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 17fd52a98..9d4490662 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -118,16 +118,14 @@ IF(SALOME_USE_PYVIEWER) ADD_SUBDIRECTORY(PyViewer) ENDIF(SALOME_USE_PYVIEWER) - ## # Python-based packages, part 1 (generic) ## -IF(SALOME_USE_PYCONSOLE) - ADD_SUBDIRECTORY(PyInterp) - ADD_SUBDIRECTORY(PyConsole) +IF(SALOME_USE_PYCONSOLE) ADD_SUBDIRECTORY(SALOME_PYQT) ENDIF(SALOME_USE_PYCONSOLE) + ## # Light SALOME packages ## diff --git a/src/LightApp/CMakeLists.txt b/src/LightApp/CMakeLists.txt index 770f9690f..de54a1970 100755 --- a/src/LightApp/CMakeLists.txt +++ b/src/LightApp/CMakeLists.txt @@ -81,8 +81,8 @@ ENDIF() IF(SALOME_USE_PYCONSOLE) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} - ${PROJECT_SOURCE_DIR}/src/PyConsole - ${PROJECT_SOURCE_DIR}/src/PyInterp + ${PROJECT_SOURCE_DIR}/tools/PyConsole/src + ${PROJECT_SOURCE_DIR}/tools/PyInterp/src ${PROJECT_SOURCE_DIR}/src/SUITApp ) ENDIF() diff --git a/src/PVServerService/CMakeLists.txt b/src/PVServerService/CMakeLists.txt index 76cfef96a..7d34b87cf 100644 --- a/src/PVServerService/CMakeLists.txt +++ b/src/PVServerService/CMakeLists.txt @@ -25,7 +25,7 @@ ENDIF() INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${KERNEL_INCLUDE_DIRS} - ${PROJECT_SOURCE_DIR}/src/PyInterp + ${PROJECT_SOURCE_DIR}/tools/PyInterp/src ) ADD_DEFINITIONS( diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt b/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt index a9d20317b..ded75b88f 100755 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/CMakeLists.txt @@ -35,12 +35,12 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/src/CAM ${PROJECT_SOURCE_DIR}/src/LightApp - ${PROJECT_SOURCE_DIR}/src/PyInterp ${PROJECT_SOURCE_DIR}/src/Qtx ${PROJECT_SOURCE_DIR}/src/SALOME_PYQT/SALOME_PYQT_GUILight ${PROJECT_SOURCE_DIR}/src/STD ${PROJECT_SOURCE_DIR}/src/SUIT ${PROJECT_SOURCE_DIR}/src/SalomeApp + ${PROJECT_SOURCE_DIR}/tools/PyInterp/src ) # additional preprocessor / compiler flags @@ -85,7 +85,6 @@ SET(_other_SOURCES SALOME_PYQT_Module.cxx) SET(SalomePyQtGUI_SOURCES ${_other_SOURCES} ${_moc_SOURCES}) # --- rules --- - ADD_LIBRARY(SalomePyQtGUI ${SalomePyQtGUI_SOURCES}) TARGET_LINK_LIBRARIES(SalomePyQtGUI ${_link_LIBRARIES}) INSTALL(TARGETS SalomePyQtGUI DESTINATION ${SALOME_INSTALL_LIBS}) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt b/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt index ec0226395..5c452c83f 100755 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt @@ -39,13 +39,13 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/LightApp ${PROJECT_SOURCE_DIR}/src/OCCViewer ${PROJECT_SOURCE_DIR}/src/Plot2d - ${PROJECT_SOURCE_DIR}/src/PyConsole - ${PROJECT_SOURCE_DIR}/src/PyInterp ${PROJECT_SOURCE_DIR}/src/Qtx ${PROJECT_SOURCE_DIR}/src/STD ${PROJECT_SOURCE_DIR}/src/SUIT ${PROJECT_SOURCE_DIR}/src/SUITApp ${PROJECT_SOURCE_DIR}/src/ObjBrowser + ${PROJECT_SOURCE_DIR}/tools/PyConsole/src + ${PROJECT_SOURCE_DIR}/tools/PyInterp/src ) # additional preprocessor / compiler flags diff --git a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt index 3b2114600..3756b7ce8 100755 --- a/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt +++ b/src/SALOME_PYQT/SalomePyQt/CMakeLists.txt @@ -40,12 +40,12 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/LogWindow ${PROJECT_SOURCE_DIR}/src/OBJECT ${PROJECT_SOURCE_DIR}/src/ObjBrowser - ${PROJECT_SOURCE_DIR}/src/PyInterp - ${PROJECT_SOURCE_DIR}/src/PyConsole ${PROJECT_SOURCE_DIR}/src/Qtx ${PROJECT_SOURCE_DIR}/src/SALOME_PYQT/SALOME_PYQT_GUILight ${PROJECT_SOURCE_DIR}/src/STD ${PROJECT_SOURCE_DIR}/src/SUIT + ${PROJECT_SOURCE_DIR}/tools/PyInterp/src + ${PROJECT_SOURCE_DIR}/tools/PyConsole/src ) IF(SALOME_USE_OCCVIEWER) diff --git a/src/SalomeApp/CMakeLists.txt b/src/SalomeApp/CMakeLists.txt index bf2fd3911..d65ba0b38 100755 --- a/src/SalomeApp/CMakeLists.txt +++ b/src/SalomeApp/CMakeLists.txt @@ -56,8 +56,8 @@ INCLUDE_DIRECTORIES( IF(SALOME_USE_PYCONSOLE) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} - ${PROJECT_SOURCE_DIR}/src/PyConsole - ${PROJECT_SOURCE_DIR}/src/PyInterp + ${PROJECT_SOURCE_DIR}/tools/PyConsole/src + ${PROJECT_SOURCE_DIR}/tools/PyInterp/src ) ENDIF() 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 new file mode 100644 index 000000000..136b81e9b --- /dev/null +++ b/tools/PyConsole/CMakeLists.txt @@ -0,0 +1,90 @@ +# Copyright (C) 2015-2016 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR) +PROJECT(PyConsole C CXX) + +# Versioning +# =========== +# Project name, upper case +STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) + +################### +# To be changed once externalized CMake procedure: +SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") +IF(EXISTS ${KERNEL_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files") + INCLUDE(SalomeMacros) +ELSE(EXISTS ${KERNEL_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR") +ENDIF(EXISTS ${KERNEL_ROOT_DIR}) +# From GUI - again to be changed once externalized: +LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../adm_local/cmake_files") +################### + +# Platform setup +# ============== +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) + +# Qt +IF(NOT PYCONSOLE_BUILD_WITH_QT5) + FIND_PACKAGE(SalomeQt4 REQUIRED) +ELSE() + FIND_PACKAGE(SalomeQt5 REQUIRED) +ENDIF() + +# Detection report +SALOME_PACKAGE_REPORT_AND_CHECK() + +# Directories +# +# Directories have to be given after prerequisites (to be able to use +# Python version string for example). +# =========== +SET(PYCONSOLE_INSTALL_LIBS lib CACHE PATH "Install path: PyConsole libs") +SET(PYCONSOLE_INSTALL_HEADERS include CACHE PATH "Install path: PyConsole headers") + +SET(PYCONSOLE_INSTALL_RES share/resources CACHE PATH "Install path: PyConsole resources") + +# Tool dependencies +# ================= +# PyConsole depends on PyInterp: +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) + +# Sources +# ======== +ADD_SUBDIRECTORY(src) + diff --git a/src/PyConsole/CMakeLists.txt b/tools/PyConsole/src/CMakeLists.txt similarity index 89% rename from src/PyConsole/CMakeLists.txt rename to tools/PyConsole/src/CMakeLists.txt index 713769e8b..113f808b3 100755 --- a/src/PyConsole/CMakeLists.txt +++ b/tools/PyConsole/src/CMakeLists.txt @@ -83,7 +83,7 @@ SET(PyConsole_SOURCES ${_other_SOURCES} ${_moc_SOURCES}) ADD_LIBRARY(PyConsole ${PyConsole_SOURCES}) TARGET_LINK_LIBRARIES(PyConsole ${_link_LIBRARIES}) -INSTALL(TARGETS PyConsole EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +INSTALL(TARGETS PyConsole EXPORT ${TOOLS_EXPORT_NAME}TargetGroup DESTINATION ${PYCONSOLE_INSTALL_LIBS}) -INSTALL(FILES ${PyConsole_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) -QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}") +INSTALL(FILES ${PyConsole_HEADERS} DESTINATION ${PYCONSOLE_INSTALL_HEADERS}) +QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${PYCONSOLE_INSTALL_RES}") diff --git a/src/PyConsole/PyConsole.h b/tools/PyConsole/src/PyConsole.h similarity index 100% rename from src/PyConsole/PyConsole.h rename to tools/PyConsole/src/PyConsole.h diff --git a/src/PyConsole/PyConsole_Console.cxx b/tools/PyConsole/src/PyConsole_Console.cxx similarity index 100% rename from src/PyConsole/PyConsole_Console.cxx rename to tools/PyConsole/src/PyConsole_Console.cxx diff --git a/src/PyConsole/PyConsole_Console.h b/tools/PyConsole/src/PyConsole_Console.h similarity index 100% rename from src/PyConsole/PyConsole_Console.h rename to tools/PyConsole/src/PyConsole_Console.h diff --git a/src/PyConsole/PyConsole_Editor.cxx b/tools/PyConsole/src/PyConsole_Editor.cxx similarity index 100% rename from src/PyConsole/PyConsole_Editor.cxx rename to tools/PyConsole/src/PyConsole_Editor.cxx diff --git a/src/PyConsole/PyConsole_Editor.h b/tools/PyConsole/src/PyConsole_Editor.h similarity index 100% rename from src/PyConsole/PyConsole_Editor.h rename to tools/PyConsole/src/PyConsole_Editor.h diff --git a/src/PyConsole/PyConsole_Event.cxx b/tools/PyConsole/src/PyConsole_Event.cxx similarity index 100% rename from src/PyConsole/PyConsole_Event.cxx rename to tools/PyConsole/src/PyConsole_Event.cxx diff --git a/src/PyConsole/PyConsole_Event.h b/tools/PyConsole/src/PyConsole_Event.h similarity index 100% rename from src/PyConsole/PyConsole_Event.h rename to tools/PyConsole/src/PyConsole_Event.h diff --git a/src/PyConsole/PyConsole_Interp.cxx b/tools/PyConsole/src/PyConsole_Interp.cxx similarity index 100% rename from src/PyConsole/PyConsole_Interp.cxx rename to tools/PyConsole/src/PyConsole_Interp.cxx diff --git a/src/PyConsole/PyConsole_Interp.h b/tools/PyConsole/src/PyConsole_Interp.h similarity index 100% rename from src/PyConsole/PyConsole_Interp.h rename to tools/PyConsole/src/PyConsole_Interp.h diff --git a/src/PyConsole/PyConsole_Request.cxx b/tools/PyConsole/src/PyConsole_Request.cxx similarity index 100% rename from src/PyConsole/PyConsole_Request.cxx rename to tools/PyConsole/src/PyConsole_Request.cxx diff --git a/src/PyConsole/PyConsole_Request.h b/tools/PyConsole/src/PyConsole_Request.h similarity index 100% rename from src/PyConsole/PyConsole_Request.h rename to tools/PyConsole/src/PyConsole_Request.h diff --git a/src/PyConsole/resources/PyConsole_msg_en.ts b/tools/PyConsole/src/resources/PyConsole_msg_en.ts similarity index 100% rename from src/PyConsole/resources/PyConsole_msg_en.ts rename to tools/PyConsole/src/resources/PyConsole_msg_en.ts diff --git a/src/PyConsole/resources/PyConsole_msg_fr.ts b/tools/PyConsole/src/resources/PyConsole_msg_fr.ts similarity index 100% rename from src/PyConsole/resources/PyConsole_msg_fr.ts rename to tools/PyConsole/src/resources/PyConsole_msg_fr.ts diff --git a/src/PyConsole/resources/PyConsole_msg_ja.ts b/tools/PyConsole/src/resources/PyConsole_msg_ja.ts similarity index 100% rename from src/PyConsole/resources/PyConsole_msg_ja.ts rename to tools/PyConsole/src/resources/PyConsole_msg_ja.ts diff --git a/tools/PyInterp/CMakeLists.txt b/tools/PyInterp/CMakeLists.txt new file mode 100644 index 000000000..40c20ba81 --- /dev/null +++ b/tools/PyInterp/CMakeLists.txt @@ -0,0 +1,78 @@ +# Copyright (C) 2015-2016 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR) +PROJECT(PyInterp C CXX) + +# Versioning +# =========== +# Project name, upper case +STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) + +# To be changed once externalized CMake procedure: +################### +SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") +IF(EXISTS ${KERNEL_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files") + INCLUDE(SalomeMacros) +ELSE(EXISTS ${KERNEL_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR") +ENDIF(EXISTS ${KERNEL_ROOT_DIR}) +# From GUI - again to be changed once externalized: +LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../adm_local/cmake_files") +################### + +# Platform setup +# ============== +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) +# Qt +IF(NOT PYINTERP_BUILD_WITH_QT5) + FIND_PACKAGE(SalomeQt4 REQUIRED) +ELSE() + FIND_PACKAGE(SalomeQt5 REQUIRED) +ENDIF() + +# Detection report +SALOME_PACKAGE_REPORT_AND_CHECK() + +# Directories +# +# Directories have to be given after prerequisites (to be able to use +# Python version string for example). +# =========== +SET(PYINTERP_INSTALL_LIBS lib CACHE PATH "Install path: PyInterp libs") +SET(PYINTERP_INSTALL_HEADERS include CACHE PATH "Install path: PyInterp headers") + +SET(PYINTERP_INSTALL_RES share/resources CACHE PATH "Install path: PyInterp resources") + +# Sources +# ======== +ADD_SUBDIRECTORY(src) + diff --git a/src/PyInterp/CMakeLists.txt b/tools/PyInterp/src/CMakeLists.txt similarity index 91% rename from src/PyInterp/CMakeLists.txt rename to tools/PyInterp/src/CMakeLists.txt index d44a73ff3..c29e7e5fd 100755 --- a/src/PyInterp/CMakeLists.txt +++ b/tools/PyInterp/src/CMakeLists.txt @@ -72,6 +72,6 @@ SET(PyInterp_SOURCES ${_other_SOURCES} ${_moc_SOURCES}) ADD_LIBRARY(PyInterp ${PyInterp_SOURCES}) TARGET_LINK_LIBRARIES(PyInterp ${_link_LIBRARIES}) -INSTALL(TARGETS PyInterp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +INSTALL(TARGETS PyInterp EXPORT ${TOOLS_EXPORT_NAME}TargetGroup DESTINATION ${PYINTERP_INSTALL_LIBS}) -INSTALL(FILES ${PyInterp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES ${PyInterp_HEADERS} DESTINATION ${PYINTERP_INSTALL_HEADERS}) diff --git a/src/PyInterp/PyInterp.h b/tools/PyInterp/src/PyInterp.h similarity index 100% rename from src/PyInterp/PyInterp.h rename to tools/PyInterp/src/PyInterp.h diff --git a/src/PyInterp/PyInterp_Dispatcher.cxx b/tools/PyInterp/src/PyInterp_Dispatcher.cxx similarity index 100% rename from src/PyInterp/PyInterp_Dispatcher.cxx rename to tools/PyInterp/src/PyInterp_Dispatcher.cxx diff --git a/src/PyInterp/PyInterp_Dispatcher.h b/tools/PyInterp/src/PyInterp_Dispatcher.h similarity index 100% rename from src/PyInterp/PyInterp_Dispatcher.h rename to tools/PyInterp/src/PyInterp_Dispatcher.h diff --git a/src/PyInterp/PyInterp_Event.cxx b/tools/PyInterp/src/PyInterp_Event.cxx similarity index 100% rename from src/PyInterp/PyInterp_Event.cxx rename to tools/PyInterp/src/PyInterp_Event.cxx diff --git a/src/PyInterp/PyInterp_Event.h b/tools/PyInterp/src/PyInterp_Event.h similarity index 100% rename from src/PyInterp/PyInterp_Event.h rename to tools/PyInterp/src/PyInterp_Event.h diff --git a/src/PyInterp/PyInterp_Interp.cxx b/tools/PyInterp/src/PyInterp_Interp.cxx similarity index 100% rename from src/PyInterp/PyInterp_Interp.cxx rename to tools/PyInterp/src/PyInterp_Interp.cxx diff --git a/src/PyInterp/PyInterp_Interp.h b/tools/PyInterp/src/PyInterp_Interp.h similarity index 100% rename from src/PyInterp/PyInterp_Interp.h rename to tools/PyInterp/src/PyInterp_Interp.h diff --git a/src/PyInterp/PyInterp_Request.cxx b/tools/PyInterp/src/PyInterp_Request.cxx similarity index 100% rename from src/PyInterp/PyInterp_Request.cxx rename to tools/PyInterp/src/PyInterp_Request.cxx diff --git a/src/PyInterp/PyInterp_Request.h b/tools/PyInterp/src/PyInterp_Request.h similarity index 100% rename from src/PyInterp/PyInterp_Request.h rename to tools/PyInterp/src/PyInterp_Request.h diff --git a/src/PyInterp/PyInterp_Utils.h b/tools/PyInterp/src/PyInterp_Utils.h similarity index 100% rename from src/PyInterp/PyInterp_Utils.h rename to tools/PyInterp/src/PyInterp_Utils.h -- 2.39.2