Salome HOME
According to cotech80 PyConsoleBase->PyConsole and PyConsole->SalomePyConsole
[modules/gui.git] / src / LightApp / 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(UseQt4Ext)
21
22 # --- options ---
23
24 # additional include directories
25 INCLUDE_DIRECTORIES(
26   ${CAS_INCLUDE_DIRS}
27   ${QT_INCLUDES}
28   ${HDF5_INCLUDE_DIRS}
29   ${PTHREAD_INCLUDE_DIR}
30   ${PROJECT_BINARY_DIR}
31   ${PROJECT_SOURCE_DIR}/src/CAM
32   ${PROJECT_SOURCE_DIR}/src/CASCatch
33   ${PROJECT_SOURCE_DIR}/src/Event
34   ${PROJECT_SOURCE_DIR}/src/LogWindow
35   ${PROJECT_SOURCE_DIR}/src/ObjBrowser
36   ${PROJECT_SOURCE_DIR}/src/Prs
37   ${PROJECT_SOURCE_DIR}/src/Qtx
38   ${PROJECT_SOURCE_DIR}/src/STD
39   ${PROJECT_SOURCE_DIR}/src/SUIT
40   ${PROJECT_SOURCE_DIR}/src/Style
41 )
42 IF(SALOME_USE_SALOMEOBJECT)
43   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/OBJECT)
44 ENDIF()
45 IF(SALOME_USE_GLVIEWER)
46   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/GLViewer)
47 ENDIF()
48 IF(SALOME_USE_GRAPHICSVIEW)
49   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/GraphicsView)
50 ENDIF()
51 IF(SALOME_USE_PYVIEWER)
52   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/PyEditor)
53   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/PyViewer)
54 ENDIF()
55 IF(SALOME_USE_OCCVIEWER)
56   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/OCCViewer)
57   IF(SALOME_USE_SALOMEOBJECT)
58     INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/SOCC)
59   ENDIF()
60 ENDIF()
61 IF(SALOME_USE_PLOT2DVIEWER)
62   INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIR})
63   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Plot2d)
64   IF(SALOME_USE_SALOMEOBJECT)
65     INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/SPlot2d)
66   ENDIF()
67 ENDIF()
68 IF(SALOME_USE_VTKVIEWER)
69   INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
70   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/VTKViewer)
71   IF(SALOME_USE_SALOMEOBJECT)
72     INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/SVTK)
73   ENDIF()
74 ENDIF()
75 IF(SALOME_USE_QXGRAPHVIEWER)
76   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/QxScene)
77 ENDIF()
78 IF(SALOME_USE_PVVIEWER)
79   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/PVViewer)
80 ENDIF()
81 IF(SALOME_USE_PYCONSOLE)
82   INCLUDE_DIRECTORIES(
83     ${PYTHON_INCLUDE_DIRS}
84     ${PROJECT_SOURCE_DIR}/src/SalomePyConsole
85     ${PROJECT_SOURCE_DIR}/src/PyConsole
86     ${PROJECT_SOURCE_DIR}/src/PyInterp
87     ${PROJECT_SOURCE_DIR}/src/SUITApp
88   )
89 ENDIF()
90
91 # additional preprocessor / compiler flags
92 ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${HDF5_DEFINITIONS})
93 IF(SALOME_USE_PLOT2DVIEWER)
94   ADD_DEFINITIONS(${QWT_DEFINITIONS})
95 ENDIF()
96 IF(SALOME_USE_PYCONSOLE)
97   ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
98 ENDIF()
99
100 # libraries to link to
101 SET(_link_LIBRARIES
102   ${CAS_KERNEL}
103   ${QT_LIBRARIES}
104   ${HDF5_LIBRARIES}
105   CASCatch qtx suit std SalomeStyle SalomePrs CAM LogWindow ObjBrowser Event 
106   ${KERNEL_SalomeHDFPersist} ${KERNEL_SALOMELocalTrace}
107 )
108 IF(SALOME_USE_SALOMEOBJECT)
109   LIST(APPEND _link_LIBRARIES SalomeObject)
110 ENDIF()
111 IF(SALOME_USE_GLVIEWER)
112   LIST(APPEND _link_LIBRARIES GLViewer)
113 ENDIF()
114 IF(SALOME_USE_GRAPHICSVIEW)
115   LIST(APPEND _link_LIBRARIES GraphicsView)
116 ENDIF()
117 IF(SALOME_USE_PYVIEWER)
118   LIST(APPEND _link_LIBRARIES PyEditor PyViewer)
119 ENDIF()
120 IF(SALOME_USE_OCCVIEWER)
121   LIST(APPEND _link_LIBRARIES OCCViewer)
122   IF(SALOME_USE_SALOMEOBJECT)
123     LIST(APPEND _link_LIBRARIES SOCC)
124   ENDIF()
125 ENDIF()
126 IF(SALOME_USE_PLOT2DVIEWER)
127   LIST(APPEND _link_LIBRARIES Plot2d)
128   IF(SALOME_USE_SALOMEOBJECT)
129     LIST(APPEND _link_LIBRARIES SPlot2d)
130   ENDIF()
131 ENDIF()
132 IF(SALOME_USE_VTKVIEWER)
133   LIST(APPEND _link_LIBRARIES VTKViewer)
134   IF(SALOME_USE_SALOMEOBJECT)
135     LIST(APPEND _link_LIBRARIES SVTK)
136   ENDIF()
137 ENDIF()
138 IF(SALOME_USE_QXGRAPHVIEWER)
139   LIST(APPEND _link_LIBRARIES QxScene)
140 ENDIF()
141 IF(SALOME_USE_PVVIEWER)
142   LIST(APPEND _link_LIBRARIES PVViewer)
143 ENDIF()
144 IF(SALOME_USE_PYCONSOLE)
145   LIST(APPEND _link_LIBRARIES PyInterp SalomePyConsole SUITApp)
146 ENDIF()
147
148 # --- headers ---
149
150 # header files / to be processed by moc
151 SET(_moc_HEADERS   
152   LightApp_AboutDlg.h
153   LightApp_Application.h
154   LightApp_DataModel.h
155   LightApp_Dialog.h
156   LightApp_Module.h
157   LightApp_ModuleAction.h
158   LightApp_ModuleDlg.h
159   LightApp_NameDlg.h
160   LightApp_OBSelector.h
161   LightApp_Operation.h
162   LightApp_Preferences.h
163   LightApp_PreferencesDlg.h
164   LightApp_SelectionMgr.h
165   LightApp_ShowHideOp.h
166   LightApp_Study.h
167   LightApp_SwitchOp.h
168   LightApp_WgViewModel.h
169 )
170 IF(SALOME_USE_GLVIEWER)
171   LIST(APPEND _moc_HEADERS LightApp_GLSelector.h)
172 ENDIF()
173 IF(SALOME_USE_GRAPHICSVIEW)
174   LIST(APPEND _moc_HEADERS LightApp_GVSelector.h)
175 ENDIF()
176 IF(SALOME_USE_OCCVIEWER)
177   LIST(APPEND _moc_HEADERS LightApp_OCCSelector.h)
178 ENDIF()
179 IF(SALOME_USE_PLOT2DVIEWER)
180   LIST(APPEND _moc_HEADERS LightApp_Plot2dSelector.h)
181 ENDIF()
182 IF(SALOME_USE_VTKVIEWER)
183   IF(SALOME_USE_SALOMEOBJECT)
184     LIST(APPEND _moc_HEADERS LightApp_VTKSelector.h)
185   ENDIF()
186 ENDIF()
187
188 # header files / no moc processing
189 SET(_other_HEADERS
190   LightApp.h
191   LightApp_DataObject.h
192   LightApp_DataOwner.h
193   LightApp_DataSubOwner.h
194   LightApp_Displayer.h
195   LightApp_Driver.h
196   LightApp_EventFilter.h
197   LightApp_FullScreenHelper.h
198   LightApp_HDFDriver.h
199   LightApp_Selection.h
200   LightApp_UpdateFlags.h
201 )
202 IF(SALOME_USE_PYCONSOLE)
203   LIST(APPEND _other_HEADERS LightApp_PyInterp.h)
204 ENDIF()
205
206 # header files / to install
207 SET(LightApp_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
208
209 # --- resources ---
210
211 # resource files / to be processed by rcc
212 SET(_rcc_RESOURCES LightApp.qrc)
213
214 # resource files / to be processed by lrelease
215 SET(_ts_RESOURCES
216   resources/LightApp_images.ts
217   resources/LightApp_msg_en.ts
218   resources/LightApp_msg_fr.ts
219   resources/LightApp_msg_ja.ts
220 )
221
222 # resource files / static
223 SET(_other_RESOURCES
224   resources/icon_about.png
225   resources/icon_applogo.png
226   resources/icon_default.png
227   resources/icon_module.png
228   resources/icon_module_big.png
229   resources/icon_select.png
230   resources/LightApp.ini
231   resources/LightApp.xml
232 )
233
234 # --- sources ---
235
236 # sources / rcc wrappings
237 QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
238
239 # sources / moc wrappings
240 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
241
242 # sources / static
243 SET(_other_SOURCES
244   LightApp_AboutDlg.cxx
245   LightApp_Application.cxx
246   LightApp_DataModel.cxx
247   LightApp_DataObject.cxx
248   LightApp_DataOwner.cxx
249   LightApp_DataSubOwner.cxx
250   LightApp_Dialog.cxx
251   LightApp_Displayer.cxx
252   LightApp_Driver.cxx
253   LightApp_EventFilter.cxx
254   LightApp_FullScreenHelper.cxx
255   LightApp_HDFDriver.cxx
256   LightApp_Module.cxx
257   LightApp_ModuleAction.cxx
258   LightApp_ModuleDlg.cxx
259   LightApp_NameDlg.cxx
260   LightApp_OBSelector.cxx
261   LightApp_Operation.cxx
262   LightApp_Preferences.cxx
263   LightApp_PreferencesDlg.cxx
264   LightApp_Selection.cxx
265   LightApp_SelectionMgr.cxx
266   LightApp_ShowHideOp.cxx
267   LightApp_Study.cxx
268   LightApp_SwitchOp.cxx
269   LightApp_WgViewModel.cxx
270 )
271 IF(SALOME_USE_GLVIEWER)
272   LIST(APPEND _other_SOURCES LightApp_GLSelector.cxx)
273 ENDIF()
274 IF(SALOME_USE_GRAPHICSVIEW)
275   LIST(APPEND _other_SOURCES LightApp_GVSelector.cxx)
276 ENDIF()
277 IF(SALOME_USE_OCCVIEWER)
278   LIST(APPEND _other_SOURCES LightApp_OCCSelector.cxx)
279 ENDIF()
280 IF(SALOME_USE_PLOT2DVIEWER)
281   LIST(APPEND _other_SOURCES LightApp_Plot2dSelector.cxx)
282 ENDIF()
283 IF(SALOME_USE_VTKVIEWER)
284   IF(SALOME_USE_SALOMEOBJECT)
285     LIST(APPEND _other_SOURCES LightApp_VTKSelector.cxx)
286   ENDIF()
287 ENDIF()
288 IF(SALOME_USE_PYCONSOLE)
289   LIST(APPEND _other_SOURCES LightApp_PyInterp.cxx)
290 ENDIF()
291
292 # sources / to compile
293 SET(LightApp_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_rcc_SOURCES})
294
295 # --- rules ---
296
297 ADD_LIBRARY(LightApp ${LightApp_SOURCES})
298 TARGET_LINK_LIBRARIES(LightApp ${_link_LIBRARIES})
299 INSTALL(TARGETS LightApp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
300
301 INSTALL(FILES ${LightApp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
302 QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
303
304 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})