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