Salome HOME
2bd80fa2a5ea9c9b48a51fb042ebbd547e14d1e7
[tools/ydefx.git] / CMakeLists.txt
1 # Copyright (C) 2019  EDF R&D
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
20 PROJECT(ydefx)
21
22 SET (CMAKE_CXX_STANDARD 11)
23 ENABLE_TESTING()
24 SET(BUILD_SHARED_LIBS TRUE)
25
26 OPTION(YDEFX_BUILD_GUI "Generate widgets" ON)
27
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")
31   INCLUDE(SalomeMacros)
32   INCLUDE(SalomeSetupPlatform)
33 ELSE()
34   MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !"
35 )
36 ENDIF()
37
38 FIND_PACKAGE(SalomePythonInterp REQUIRED)
39 FIND_PACKAGE(SalomePythonLibs REQUIRED)
40
41 SET(PY2CPP_ROOT_DIR $ENV{PY2CPP_ROOT_DIR} CACHE PATH "Path to py2cpp")
42 IF( EXISTS ${PY2CPP_ROOT_DIR} )
43   LIST(APPEND CMAKE_MODULE_PATH "${PY2CPP_ROOT_DIR}/lib/cmake/py2cpp")
44 ELSE()
45   MESSAGE(FATAL_ERROR "We absolutely need py2cpp, please define PY2CPP_ROOT_DIR")
46 ENDIF()
47 FIND_PACKAGE(Py2cpp REQUIRED)
48
49 IF(YDEFX_BUILD_GUI)
50   FIND_PACKAGE(Qt5Widgets CONFIG REQUIRED)
51 ENDIF(YDEFX_BUILD_GUI)
52
53 SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install Python files")
54
55 ADD_SUBDIRECTORY(src)