Salome HOME
YDEFX: integration
[tools/sat_salome.git] / products / patches / YDEFX-CMakeLists.patch
1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 8959cac..e5d03fc 100644
3 --- a/CMakeLists.txt
4 +++ b/CMakeLists.txt
5 @@ -23,14 +23,33 @@ SET (CMAKE_CXX_STANDARD 11)
6  ENABLE_TESTING()
7  SET(BUILD_SHARED_LIBS TRUE)
8  
9 +SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
10 +IF(EXISTS ${CONFIGURATION_ROOT_DIR})
11 +  LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
12 +  INCLUDE(SalomeMacros NO_POLICY_SCOPE)
13 +ELSE()
14 +  MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
15 +ENDIF()
16 +
17 +SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
18 +IF(EXISTS ${KERNEL_ROOT_DIR})
19 +  FIND_PACKAGE(SalomeKERNEL REQUIRED)
20 +  ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
21 +  INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
22 +ELSE(EXISTS ${KERNEL_ROOT_DIR})
23 +  MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
24 +ENDIF(EXISTS ${KERNEL_ROOT_DIR})
25 +
26 +# Platform setup
27 +# ==============
28 +INCLUDE(SalomeSetupPlatform)   # From CONFIGURATION
29 +# Always build libraries as shared objects:
30 +SET(BUILD_SHARED_LIBS TRUE)
31 +
32  OPTION(YDEFX_BUILD_GUI "Generate widgets" ON)
33  
34  FIND_PACKAGE(Py2cpp REQUIRED)
35  
36 -# SalomeKERNEL can be useful in order to define SALOME_INSTALL directories and
37 -# for using salome test, but it is not a c++ dependency.
38 -FIND_PACKAGE(SalomeKERNEL NO_MODULE)
39 -
40  IF(NOT SalomeKERNEL_FOUND)
41    MESSAGE("SalomeKERNEL not found. Salome installation paths will not be used")
42  ELSE()