Salome HOME
Add resource widget.
[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 ELSE()
33   MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !"
34 )
35 ENDIF()
36
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")
40 ELSE()
41   MESSAGE(FATAL_ERROR "We absolutely need Salome KERNEL, please define KERNEL_ROOT_DIR")
42 ENDIF()
43 FIND_PACKAGE(SalomeKERNEL REQUIRED)
44 ADD_DEFINITIONS(${KERNEL_DEFINITIONS} )
45 INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
46
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")
50 ELSE()
51   MESSAGE(FATAL_ERROR "We absolutely need Salome YACS, please define YACS_ROOT_DIR")
52 ENDIF()
53 FIND_PACKAGE(SalomeYACS REQUIRED)
54 ADD_DEFINITIONS(${YACS_DEFINITIONS})
55 INCLUDE_DIRECTORIES(${YACS_INCLUDE_DIRS})
56
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")
60 ELSE()
61   MESSAGE(FATAL_ERROR "We absolutely need py2cpp, please define PY2CPP_ROOT_DIR")
62 ENDIF()
63 FIND_PACKAGE(Py2cpp REQUIRED)
64
65 IF(YDEFX_BUILD_GUI)
66   FIND_PACKAGE(Qt5Widgets CONFIG REQUIRED)
67 ENDIF(YDEFX_BUILD_GUI)
68
69 SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install Python files")
70
71 ADD_SUBDIRECTORY(src)