]> SALOME platform Git repositories - modules/gui.git/blob - src/SALOME_PYQT/SalomePyQt/CMakeLists.txt
Salome HOME
According to cotech80 PyConsoleBase->PyConsole and PyConsole->SalomePyConsole
[modules/gui.git] / src / SALOME_PYQT / SalomePyQt / CMakeLists.txt
1 # Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
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
20 INCLUDE(UseQtExt)
21 INCLUDE(UsePyQt)
22 IF(SALOME_USE_VTKVIEWER)
23   INCLUDE(${VTK_USE_FILE})
24 ENDIF()
25
26 # --- options ---
27
28 # additional include directories
29 INCLUDE_DIRECTORIES(
30   ${CAS_INCLUDE_DIRS}
31   ${QT_INCLUDES}
32   ${QWT_INCLUDE_DIR}
33   ${SIP_INCLUDE_DIR}
34   ${Boost_INCLUDE_DIRS}
35   ${PYTHON_INCLUDE_DIRS}
36   ${CMAKE_CURRENT_SOURCE_DIR}
37   ${PROJECT_SOURCE_DIR}/src/CAM
38   ${PROJECT_SOURCE_DIR}/src/Event
39   ${PROJECT_SOURCE_DIR}/src/LightApp
40   ${PROJECT_SOURCE_DIR}/src/LogWindow
41   ${PROJECT_SOURCE_DIR}/src/OBJECT
42   ${PROJECT_SOURCE_DIR}/src/ObjBrowser
43   ${PROJECT_SOURCE_DIR}/src/PyInterp
44   ${PROJECT_SOURCE_DIR}/src/PyConsole
45   ${PROJECT_SOURCE_DIR}/src/SalomePyConsole
46   ${PROJECT_SOURCE_DIR}/src/Qtx
47   ${PROJECT_SOURCE_DIR}/src/SALOME_PYQT/SALOME_PYQT_GUILight
48   ${PROJECT_SOURCE_DIR}/src/STD
49   ${PROJECT_SOURCE_DIR}/src/SUIT
50 )
51
52 IF(SALOME_USE_OCCVIEWER)
53   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/OCCViewer)
54 ENDIF(SALOME_USE_OCCVIEWER)
55 IF(SALOME_USE_PVVIEWER)
56   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/PVViewer)
57 ENDIF(SALOME_USE_PVVIEWER)
58 IF(SALOME_USE_PLOT2DVIEWER)
59   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Plot2d)
60 ELSE(SALOME_USE_PLOT2DVIEWER)
61   #disable 'ENABLE_PLOT2D' feature
62   SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} "-xENABLE_PLOT2D;")
63 ENDIF(SALOME_USE_PLOT2DVIEWER)
64
65 IF(SALOME_LIGHT_ONLY)
66   #disable 'ENABLE_CORBA' feature
67   SET(PYQT_SIPFLAGS ${PYQT_SIPFLAGS} "-xENABLE_CORBA;")
68 ELSE(SALOME_LIGHT_ONLY)
69   INCLUDE_DIRECTORIES(
70     ${PROJECT_SOURCE_DIR}/src/SalomeApp
71   )
72 ENDIF(SALOME_LIGHT_ONLY)
73
74 # additional preprocessor / compiler flags
75 ADD_DEFINITIONS(
76   ${QWT_DEFINITIONS}
77   ${QT_DEFINITIONS}
78   ${CAS_DEFINITIONS}
79   ${BOOST_DEFINITIONS}
80   ${PYTHON_DEFINITIONS}
81   ${OMNIORB_DEFINITIONS}
82 )
83
84 # libraries to link to
85 SET(_link_LIBRARIES
86   ${PYTHON_LIBRARIES}
87   ${VTK_LIBRARIES}
88   ${OPENGL_LIBRARIES}
89   ${QWT_LIBRARY}
90   SalomePyQtGUILight
91
92
93 # --- headers ---
94
95 # header files / to be processed by moc
96 SET(_moc_HEADERS SalomePyQt.h)
97
98 # --- resources ---
99
100 # sip files / to be processed by sip
101 SET(_sip_files SalomePyQt.sip)
102 IF(SALOME_USE_PLOT2DVIEWER)
103   LIST(APPEND _sip_files SalomePyQt_Plot2d.sip)
104 ENDIF(SALOME_USE_PLOT2DVIEWER)
105
106 # --- sources ---
107
108 # sources / moc wrappings
109 QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
110
111 # sources / sip wrappings
112 PYQT_WRAP_SIP(_sip_SOURCES ${_sip_files})
113
114 # sources / static
115 SET(_other_SOURCES SalomePyQt.cxx)
116
117 # sources / to compile
118 SET(SalomePyQt_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_sip_SOURCES})
119
120 # --- rules ---
121
122 ADD_LIBRARY(SalomePyQt ${SalomePyQt_SOURCES})
123 TARGET_LINK_LIBRARIES(SalomePyQt ${_link_LIBRARIES})
124 INSTALL(TARGETS SalomePyQt DESTINATION ${SALOME_INSTALL_LIBS})
125
126 IF(WIN32)
127   SET_TARGET_PROPERTIES(SalomePyQt PROPERTIES SUFFIX ".pyd" DEBUG_OUTPUT_NAME SalomePyQt_d RELEASE_OUTPUT_NAME SalomePyQt)
128 ELSE()
129   SET_TARGET_PROPERTIES(SalomePyQt PROPERTIES PREFIX "")
130 ENDIF()
131
132 FILE(GLOB make_clean_files ${CMAKE_CURRENT_BINARY_DIR}/sip*)
133 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")