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