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