-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
51 lines (38 loc) · 1.5 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
SET(CMAKE_AUTOMOC ON)
PROJECT(SalomeMyDemo C CXX)
CMAKE_POLICY(SET CMP0003 NEW)
SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
IF(EXISTS ${CONFIGURATION_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
INCLUDE(SalomeMacros)
ELSE()
MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
ENDIF()
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
INCLUDE(SalomeSetupPlatform)
SET(BUILD_SHARED_LIBS TRUE)
FIND_PACKAGE(SalomePythonInterp REQUIRED)
FIND_PACKAGE(SalomePythonLibs REQUIRED)
FIND_PACKAGE(SalomeKERNEL)
FIND_PACKAGE(SalomeGUI)
FIND_PACKAGE(SalomeQt5 REQUIRED)
SET(_moc_HEADERS
MyDemoGui.hxx
)
SET(_MyModlue_SOURCES MyDemoGui.cxx)
INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
ADD_DEFINITIONS(
${QT_DEFINITIONS}
${PYTHON_DEFINITIONS}
)
SET(_link_LIBRARIES ${GUI_LightApp})
ADD_LIBRARY(MyDemo ${_moc_HEADERS} ${_MyModlue_SOURCES})
TARGET_LINK_LIBRARIES(MyDemo ${_link_LIBRARIES})
target_compile_definitions(MyDemo PRIVATE MYDEMO_EXPORTS)
INSTALL(TARGETS MyDemo DESTINATION lib/salome)
SALOME_CONFIGURE_PREPARE(Qt5)
ADD_SUBDIRECTORY(resources)