1 # Copyright (C) 2015-2023 CEA/DEN, EDF R&D, OPEN CASCADE
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(PyInterp C CXX)
25 # Project name, uppercase / lowercase
26 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
27 STRING(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LC)
29 # Include common macros
30 # =====================
31 SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
32 IF(EXISTS ${CONFIGURATION_ROOT_DIR})
33 LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
34 INCLUDE(SalomeMacros NO_POLICY_SCOPE)
36 MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
41 INCLUDE(SalomeSetupPlatform)
45 OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
47 # Detect prerequisites
48 # ====================
51 FIND_PACKAGE(SalomePythonInterp REQUIRED)
52 FIND_PACKAGE(SalomePythonLibs REQUIRED)
54 FIND_PACKAGE(SalomeQt5 REQUIRED)
56 # Detection summary report
57 SALOME_PACKAGE_REPORT_AND_CHECK()
61 # Directories have to be given after prerequisites (to be able to use
62 # Python version string for example).
63 # ===================================================================
64 SET(PYINTERP_INSTALL_LIBS lib CACHE PATH "Install path: libraries")
65 SET(PYINTERP_INSTALL_HEADERS include CACHE PATH "Install path: headers")
66 SET(PYINTERP_INSTALL_RES share/resources CACHE PATH "Install path: resources")
67 SET(PYINTERP_INSTALL_CMAKE lib/cmake/${PROJECT_NAME_LC} CACHE PATH "Install path: cmake files")
69 MARK_AS_ADVANCED(PYINTERP_INSTALL_LIBS PYINTERP_INSTALL_HEADERS
70 PYINTERP_INSTALL_RES PYINTERP_INSTALL_CMAKE)
72 SET(PYINTERP_EXPORT_NAME ${PROJECT_NAME} CACHE STRING "Export name")
73 MARK_AS_ADVANCED(PYINTERP_EXPORT_NAME)
79 # Export configuration and targets
80 # ================================
81 IF(NOT PYINTERP_SUBPROJECT)
82 # Install the export set for use with the install-tree
83 INSTALL(EXPORT ${PYINTERP_EXPORT_NAME}TargetGroup DESTINATION ${PYINTERP_INSTALL_CMAKE}
84 FILE ${PROJECT_NAME}Targets.cmake)