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