1 # Copyright (C) 2015-2019 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
21 PROJECT(PyConsole C CXX)
25 # Project name, upper case
26 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
29 # To be changed once externalized CMake procedure:
30 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
31 IF(EXISTS ${KERNEL_ROOT_DIR})
32 LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
34 ELSE(EXISTS ${KERNEL_ROOT_DIR})
35 MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
36 ENDIF(EXISTS ${KERNEL_ROOT_DIR})
37 # From GUI - again to be changed once externalized:
38 LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../adm_local/cmake_files")
43 INCLUDE(SalomeSetupPlatform)
47 OPTION(PYCONSOLE_BUILD_PYTHON "Build Python wrapping for PyConsole" ON)
50 # Set list of prerequisites
51 # =========================
53 FIND_PACKAGE(SalomePythonInterp REQUIRED)
54 FIND_PACKAGE(SalomePythonLibs REQUIRED)
57 FIND_PACKAGE(SalomeQt5 REQUIRED)
58 IF(PYCONSOLE_BUILD_PYTHON)
60 FIND_PACKAGE(SalomeSIP REQUIRED) # should come after Python and before PyQt
61 SALOME_LOG_OPTIONAL_PACKAGE(SalomeSIP PYCONSOLE_BUILD_PYTHON)
63 FIND_PACKAGE(SalomePyQt5 REQUIRED)
64 SALOME_LOG_OPTIONAL_PACKAGE(SalomePyQt5 PYCONSOLE_BUILD_PYTHON)
65 ENDIF(PYCONSOLE_BUILD_PYTHON)
68 SALOME_PACKAGE_REPORT_AND_CHECK()
72 # Directories have to be given after prerequisites (to be able to use
73 # Python version string for example).
75 SET(PYCONSOLE_INSTALL_LIBS lib CACHE PATH "Install path: PyConsole libs")
76 SET(PYCONSOLE_INSTALL_HEADERS include CACHE PATH "Install path: PyConsole headers")
78 SET(PYCONSOLE_INSTALL_RES share/resources CACHE PATH "Install path: PyConsole resources")
82 # PyConsole depends on PyInterp:
83 SET(PYINTERP_INSTALL_LIBS "${PYCONSOLE_INSTALL_LIBS}" CACHE PATH "")
84 SET(PYINTERP_INSTALL_HEADERS "${PYCONSOLE_INSTALL_HEADERS}" CACHE PATH "")
85 SET(PYINTERP_INSTALL_RES "${PYCONSOLE_INSTALL_RES}" CACHE PATH "")
87 ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/../PyInterp ${PROJECT_BINARY_DIR}/PyInterp)
88 INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/../PyInterp/src)