Salome HOME
CMake improvement: editing of SALOME_GUI_MODE() macro, checking of optional dependenc...
[modules/gui.git] / src / SVTK / CMakeLists.txt
1 # Copyright (C) 2012-2015  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 INCLUDE(${VTK_USE_FILE})
22
23 # --- options ---
24
25 # additional include directories
26 INCLUDE_DIRECTORIES(
27   ${CAS_INCLUDE_DIRS}
28   ${QT_INCLUDES}
29   ${Boost_INCLUDE_DIRS}
30   ${PTHREAD_INCLUDE_DIR}
31   ${PROJECT_SOURCE_DIR}/src/Qtx
32   ${PROJECT_SOURCE_DIR}/src/SUIT
33   ${PROJECT_SOURCE_DIR}/src/ViewerTools
34   ${PROJECT_SOURCE_DIR}/src/OBJECT
35   ${PROJECT_SOURCE_DIR}/src/Prs
36   ${PROJECT_SOURCE_DIR}/src/VTKViewer
37 )
38
39 IF(SALOME_USE_GLVIEWER)
40   INCLUDE_DIRECTORIES(
41     ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
42     )
43 ENDIF()
44
45 # additional preprocessor / compiler flags
46 ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS})
47
48 # libraries to link to
49 SET(_link_LIBRARIES 
50   ${QT_LIBRARIES} 
51   ${OPENGL_LIBRARIES}
52   ${VTK_LIBRARIES} 
53   ${CAS_KERNEL} ${CAS_VIEWER}
54   ${KERNEL_OpUtil}
55   qtx suit ViewerTools SalomeObject SalomePrs VTKViewer
56 )
57
58 IF(SALOME_USE_GLVIEWER)
59   LIST(APPEND _link_LIBRARIES 
60     OpenGLUtils
61     )
62 ENDIF()
63
64 # --- headers ---
65
66 # header files / to be processed by moc
67 SET(_moc_HEADERS
68    SVTK_ComboAction.h
69    SVTK_FontWidget.h
70    SVTK_GenericRenderWindowInteractor.h
71    SVTK_RecorderDlg.h
72    SVTK_RenderWindowInteractor.h
73    SVTK_SetRotationPointDlg.h
74    SVTK_View.h
75    SVTK_ViewManager.h
76    SVTK_ViewModelBase.h
77    SVTK_ViewModel.h
78    SVTK_ViewParameterDlg.h
79    SVTK_ViewWindow.h
80 )
81
82 # header files / to be processed by moc / internal
83 # TODO: check for MSVS project
84 SET(_moc_internal_HEADERS
85   SVTK_CubeAxesDlg.h
86   SVTK_NonIsometricDlg.h
87   SVTK_UpdateRateDlg.h
88 )
89
90 # header files / no moc processing
91 SET(_other_HEADERS
92    SALOME_Actor.h
93    SVTK.h
94    SVTK_Actor.h
95    SVTK_AreaPicker.h
96    SVTK_CubeAxesActor2D.h
97    SVTK_DeviceActor.h
98    SVTK_Event.h
99    SVTK_Functor.h
100    SVTK_ImageWriter.h
101    SVTK_ImageWriterMgr.h
102    SVTK_InteractorStyle.h
103    SVTK_KeyFreeInteractorStyle.h
104    SVTK_Prs.h
105    SVTK_Recorder.h
106    SVTK_Renderer.h
107    SVTK_Selection.h
108    SVTK_SelectionEvent.h
109    SVTK_Selector.h
110    SVTK_SpaceMouse.h
111    SVTK_Utils.h
112 )
113
114 # header files / no moc processing / internal
115 # no processing currently: TODO: check for MSVS project
116 SET(_internal_HEADERS
117   SVTK_SelectorDef.h
118   SVTK_Trihedron.h
119   salomevtkPVAxesActor.h
120   salomevtkPVAxesWidget.h
121 )
122
123 # header files / to install
124 SET(SVTK_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
125
126 # --- resources ---
127
128 # resource files / to be processed by lrelease
129 SET(_ts_RESOURCES
130   resources/SVTK_msg_en.ts
131   resources/SVTK_msg_fr.ts
132   resources/SVTK_msg_ja.ts
133   resources/SVTK_images.ts
134 )
135
136 # resource files / static
137 SET(_other_RESOURCES
138   resources/vtk_view_graduated_axes.png
139   resources/vtk_view_highlight.png
140   resources/vtk_view_highlight_dyn.png
141   resources/vtk_view_highlight_off.png
142   resources/vtk_view_highlight_std.png
143   resources/vtk_view_parallel.png
144   resources/vtk_view_parameters.png
145   resources/vtk_view_perspective.png
146   resources/vtk_view_recording_pause.png
147   resources/vtk_view_recording_play.png
148   resources/vtk_view_recording_start.png
149   resources/vtk_view_recording_stop.png
150   resources/vtk_view_rotation_point.png
151   resources/vtk_view_scaling.png
152   resources/vtk_view_selection.png
153   resources/vtk_view_style_switch.png
154   resources/vtk_view_update_rate.png
155   resources/vtk_view_zooming_style_switch.png
156 )
157
158 # --- sources ---
159
160 # sources / moc wrappings
161 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS} ${_moc_internal_HEADERS})
162
163 # sources / static
164 SET(_other_SOURCES
165   SALOME_Actor.cxx
166   SVTK_Actor.cxx
167   SVTK_AreaPicker.cxx
168   SVTK_ComboAction.cxx
169   SVTK_CubeAxesActor2D.cxx
170   SVTK_CubeAxesDlg.cxx
171   SVTK_DeviceActor.cxx
172   SVTK_FontWidget.cxx
173   SVTK_GenericRenderWindowInteractor.cxx
174   SVTK_ImageWriter.cxx
175   SVTK_ImageWriterMgr.cxx
176   SVTK_InteractorStyle.cxx
177   SVTK_KeyFreeInteractorStyle.cxx
178   SVTK_NonIsometricDlg.cxx
179   SVTK_Prs.cxx
180   SVTK_Recorder.cxx
181   SVTK_RecorderDlg.cxx
182   SVTK_RenderWindowInteractor.cxx
183   SVTK_Renderer.cxx
184   SVTK_Selector.cxx
185   SVTK_SetRotationPointDlg.cxx
186   SVTK_SpaceMouse.cxx
187   SVTK_Trihedron.cxx
188   SVTK_UpdateRateDlg.cxx
189   SVTK_Utils.cxx
190   SVTK_View.cxx
191   SVTK_ViewManager.cxx
192   SVTK_ViewModel.cxx
193   SVTK_ViewParameterDlg.cxx
194   SVTK_ViewWindow.cxx
195   salomevtkPVAxesActor.cxx
196   salomevtkPVAxesWidget.cxx
197 )
198
199 # sources / to compile
200 SET(SVTK_SOURCES ${_other_SOURCES} ${_moc_SOURCES})
201
202 # --- rules ---
203
204 ADD_LIBRARY(SVTK ${SVTK_SOURCES})
205 TARGET_LINK_LIBRARIES(SVTK ${_link_LIBRARIES})
206 INSTALL(TARGETS SVTK EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
207
208 INSTALL(FILES ${SVTK_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
209 QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
210
211 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
212