1 # Copyright (C) 2019 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
19 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
22 SET (CMAKE_CXX_STANDARD 11)
24 SET(BUILD_SHARED_LIBS TRUE)
26 OPTION(YDEFX_BUILD_GUI "Generate widgets" ON)
28 SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
29 IF(EXISTS ${CONFIGURATION_ROOT_DIR})
30 LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
33 MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !"
37 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to Salome KERNEL")
38 IF( EXISTS ${KERNEL_ROOT_DIR} )
39 LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
41 MESSAGE(FATAL_ERROR "We absolutely need Salome KERNEL, please define KERNEL_ROOT_DIR")
43 FIND_PACKAGE(SalomeKERNEL REQUIRED)
44 ADD_DEFINITIONS(${KERNEL_DEFINITIONS} )
45 INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
47 SET(YACS_ROOT_DIR $ENV{YACS_ROOT_DIR} CACHE PATH "Path to Salome YACS")
48 IF( EXISTS ${YACS_ROOT_DIR} )
49 LIST(APPEND CMAKE_MODULE_PATH "${YACS_ROOT_DIR}/salome_adm/cmake_files")
51 MESSAGE(FATAL_ERROR "We absolutely need Salome YACS, please define YACS_ROOT_DIR")
53 FIND_PACKAGE(SalomeYACS REQUIRED)
54 ADD_DEFINITIONS(${YACS_DEFINITIONS})
55 INCLUDE_DIRECTORIES(${YACS_INCLUDE_DIRS})
57 SET(PY2CPP_ROOT_DIR $ENV{PY2CPP_ROOT_DIR} CACHE PATH "Path to py2cpp")
58 IF( EXISTS ${PY2CPP_ROOT_DIR} )
59 LIST(APPEND CMAKE_MODULE_PATH "${PY2CPP_ROOT_DIR}/lib/cmake/py2cpp")
61 MESSAGE(FATAL_ERROR "We absolutely need py2cpp, please define PY2CPP_ROOT_DIR")
63 FIND_PACKAGE(Py2cpp REQUIRED)
66 FIND_PACKAGE(Qt5Widgets CONFIG REQUIRED)
67 ENDIF(YDEFX_BUILD_GUI)
69 SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install Python files")