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