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