ENH: Added a new item delegate class to handle highlighting items
[kitware:paraview.git] / Qt / Widgets / CMakeLists.txt
1 #==========================================================================
2 #
3 #     Program: ParaView
4 #
5 #     Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
6 #     All rights reserved.
7 #
8 #     ParaView is a free software; you can redistribute it and/or modify it
9 #     under the terms of the ParaView license version 1.2.
10 #
11 #     See License_v1.2.txt for the full ParaView license.
12 #     A copy of this license can be obtained by contacting
13 #     Kitware Inc.
14 #     28 Corporate Drive
15 #     Clifton Park, NY 12065
16 #     USA
17 #
18 #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 #  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 #  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 #  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
22 #  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 #  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 #  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 #  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 #  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #
30 #==========================================================================
31 set(Module_SRCS
32   ctkRangeSlider.h
33   ctkRangeSlider.cpp
34   ctkDoubleRangeSlider.h
35   ctkDoubleRangeSlider.cpp
36   pqAnimationKeyFrame.cxx
37   pqAnimationKeyFrame.h
38   pqAnimationModel.cxx
39   pqAnimationModel.h
40   pqAnimationTrack.cxx
41   pqAnimationTrack.h
42   pqAnimationWidget.cxx
43   pqAnimationWidget.h
44   pqChartPrintSave.cxx
45   pqChartPrintSave.h
46   pqCheckableHeaderModel.cxx
47   pqCheckableHeaderModel.h
48   pqCheckableHeaderView.cxx
49   pqCheckableHeaderView.h
50   pqCheckBoxPixMaps.cxx
51   pqCheckBoxPixMaps.h
52   pqCollapsedGroup.cxx
53   pqCollapsedGroup.h
54   pqColorButtonEventPlayer.cxx
55   pqColorDialogEventPlayer.cxx
56   pqColorDialogEventPlayer.h
57   pqColorDialogEventTranslator.cxx
58   pqColorDialogEventTranslator.h
59   pqColorButtonEventPlayer.h
60   pqColorButtonEventTranslator.cxx
61   pqColorButtonEventTranslator.h
62   pqColorChooserButton.cxx
63   pqColorChooserButton.h
64   pqConnect.cxx
65   pqConnect.h
66   pqConsoleWidget.cxx
67   pqConsoleWidget.h
68   pqConsoleWidgetEventPlayer.cxx
69   pqConsoleWidgetEventPlayer.h
70   pqConsoleWidgetEventTranslator.cxx
71   pqConsoleWidgetEventTranslator.h
72   pqDelimitedTextParser.cxx
73   pqDelimitedTextParser.h
74   pqDoubleRangeDialog.cxx
75   pqDoubleRangeDialog.h
76   pqDoubleRangeWidget.cxx
77   pqDoubleRangeWidget.h
78   pqDoubleSpinBox.cxx
79   pqDoubleSpinBox.h
80   pqExpandableTableView.cxx
81   pqExpandableTableView.h
82   pqExpanderButton.cxx
83   pqExpanderButton.h
84   pqFlatTreeView.cxx
85   pqFlatTreeView.h
86   pqHelpWindow.cxx
87   pqHelpWindow.h
88   pqHighlightItemDelegate.cxx
89   pqHighlightItemDelegate.h
90   pqLineEdit.cxx
91   pqLineEdit.h
92   pqListWidgetCheckHelper.cxx
93   pqListWidgetCheckHelper.h
94   pqListWidgetItemObject.cxx
95   pqListWidgetItemObject.h
96   pqProgressBar.cxx
97   pqProgressBar.h
98   pqProgressWidget.cxx
99   pqProgressWidget.h
100   pqQuickLaunchDialog.cxx
101   pqQuickLaunchDialog.h
102   pqSectionVisibilityContextMenu.cxx
103   pqSectionVisibilityContextMenu.h
104   pqSetData.cxx
105   pqSetData.h
106   pqSetName.cxx
107   pqSetName.h
108   pqSignalAdaptors.cxx
109   pqSignalAdaptors.h
110   pqSpinBox.cxx
111   pqSpinBox.h
112   pqTableView.cxx
113   pqTableView.h
114   pqTreeView.cxx
115   pqTreeView.h
116   pqTreeViewSelectionHelper.cxx
117   pqTreeViewSelectionHelper.h
118   pqTreeWidgetCheckHelper.cxx
119   pqTreeWidgetCheckHelper.h
120   pqTreeWidget.cxx
121   pqTreeWidget.h
122   pqTreeWidgetItem.cxx
123   pqTreeWidgetItem.h
124   pqTreeWidgetItemObject.cxx
125   pqTreeWidgetItemObject.h
126   pqTreeWidgetSelectionHelper.cxx
127   pqTreeWidgetSelectionHelper.h
128   pqWaitCursor.cxx
129   pqWaitCursor.h
130 #  QtWidgetsPlugin.cxx
131 #  QtWidgetsPlugin.h
132 )
133
134 ##########################################################################
135 ## Add the header files that need to moc processed.
136 set (QtWidgets_SRCS
137 #  QtWidgetsPlugin.h
138
139   ctkRangeSlider.h
140   ctkDoubleRangeSlider.h
141   pqAnimationKeyFrame.h
142   pqAnimationModel.h
143   pqAnimationTrack.h
144   pqAnimationWidget.h
145   pqChartPrintSave.h
146   pqCheckableHeaderModel.h
147   pqCheckableHeaderView.h
148   pqCheckBoxPixMaps.h
149   pqCollapsedGroup.h
150   pqColorButtonEventPlayer.h
151   pqColorButtonEventTranslator.h
152   pqColorChooserButton.h
153   pqColorDialogEventPlayer.h
154   pqColorDialogEventTranslator.h
155   pqConsoleWidget.h
156   pqConsoleWidgetEventPlayer.h
157   pqConsoleWidgetEventTranslator.h
158   pqDelimitedTextParser.h
159   pqDoubleRangeDialog.h
160   pqDoubleRangeWidget.h
161   pqDoubleSpinBox.h
162   pqExpandableTableView.h
163   pqExpanderButton.h
164   pqFlatTreeView.h
165   pqHighlightItemDelegate.h
166   pqLineEdit.h
167   pqListWidgetCheckHelper.h
168   pqListWidgetItemObject.h
169   pqProgressBar.h
170   pqProgressWidget.h
171   pqQuickLaunchDialog.h
172   pqSectionVisibilityContextMenu.h
173   pqSignalAdaptors.h
174   pqSpinBox.h
175   pqTableView.h
176   pqTreeView.h
177   pqTreeWidget.h
178   pqTreeWidgetCheckHelper.h
179   pqTreeWidgetItemObject.h
180   pqTreeWidgetSelectionHelper.h
181   pqTreeViewSelectionHelper.h
182   pqHelpWindow.h
183 )
184
185 if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
186   QT5_WRAP_CPP(QtWidgets_MOC_SOURCES ${QtWidgets_SRCS})
187 else ()
188   QT4_WRAP_CPP(QtWidgets_MOC_SOURCES ${QtWidgets_SRCS})
189 endif ()
190
191
192 ##########################################################################
193 ## Add *.ui files to be uic processed.
194 SET(QtWidgets_UI_FORMS
195   Resources/UI/pqExpanderButton.ui
196   Resources/UI/pqHelpWindow.ui
197   Resources/UI/pqQuickLaunchDialog.ui
198 )
199
200 if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
201   QT5_WRAP_UI(QtWidgets_UI_BUILT_SOURCES
202     ${QtWidgets_UI_FORMS}
203   )
204 else ()
205   QT4_WRAP_UI(QtWidgets_UI_BUILT_SOURCES
206     ${QtWidgets_UI_FORMS}
207   )
208 endif ()
209
210 ##########################################################################
211 ## Add resources.
212 SET(UI_RESOURCES
213   Resources/QtWidgets.qrc
214 )
215
216 if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
217   QT5_ADD_RESOURCES(RCS_SOURCES
218     ${UI_RESOURCES}
219   )
220 else ()
221   QT4_ADD_RESOURCES(RCS_SOURCES
222     ${UI_RESOURCES}
223   )
224 endif ()
225
226 SOURCE_GROUP("Resources" FILES
227   ${UI_RESOURCES}
228   ${QtWidgets_UI_FORMS}
229 )
230
231 SOURCE_GROUP("Generated" FILES
232   ${QtWidgets_MOC_SOURCES}
233   ${RCS_SOURCES}
234   ${QtWidgets_UI_BUILT_SOURCES}
235 )
236
237 SET(QT_WIDGETS_ALL_SRCS ${Module_SRCS} ${QtWidgets_MOC_SOURCES}
238   ${RCS_SOURCES} ${QtWidgets_UI_BUILT_SOURCES})
239
240 ##########################################################################
241 # import Qt build settings
242
243 # Option to disable WebKit since QtWebkit has build issues on certain platforms.
244 option(PQWIDGETS_DISABLE_QTWEBKIT "Disable use of QtWebKit." OFF)
245 mark_as_advanced(PQWIDGETS_DISABLE_QTWEBKIT)
246
247 if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
248   set (Qt5_FIND_COMPONENTS
249     Widgets
250     Network
251     Help
252     PrintSupport
253     )
254   if (NOT PQWIDGETS_DISABLE_QTWEBKIT)
255     list (APPEND Qt5_FIND_COMPONENTS
256       WebKitWidgets)
257   endif()
258   include (ParaViewQt5)
259
260   # Setting this variable ensures that any module depending on pqWidgets
261   # automatically inherits the Qt include dirs.
262   set (${vtk-module}_INCLUDE_DIRS
263     ${Qt5Widgets_INCLUDE_DIRS}
264     ${Qt5Network_INCLUDE_DIRS}
265     ${Qt5Help_INCLUDE_DIRS}
266     ${Qt5PrintSupport_INCLUDE_DIRS}
267     ${Qt5WebKitWidgets_INCLUDE_DIRS})
268   
269 else (PARAVIEW_QT_VERSION VERSION_GREATER "4")
270   set (QT_USE_QTNETWORK 1)
271   set (QT_USE_QTHELP 1)
272   if (PQWIDGETS_DISABLE_QTWEBKIT)
273     set (QT_USE_QTWEBKIT 0)
274   else ()
275     set (QT_USE_QTWEBKIT 1)
276   endif ()
277
278   find_package (Qt4 REQUIRED QUIET)
279   include (${QT_USE_FILE})
280
281   # Setting this variable ensures that any module depending on pqWidgets
282   # automatically inherits the Qt include dirs.
283   set (${vtk-module}_INCLUDE_DIRS
284     ${QT_INCLUDES})
285 endif (PARAVIEW_QT_VERSION VERSION_GREATER "4")
286
287 set(${vtk-module}_NO_HeaderTest 1)
288
289 if (PQWIDGETS_DISABLE_QTWEBKIT)
290   add_definitions(-DPQWIDGETS_DISABLE_QTWEBKIT)
291 endif()
292
293 vtk_module_library(${vtk-module} ${QT_WIDGETS_ALL_SRCS})
294 target_link_libraries(${vtk-module} LINK_PUBLIC ${QT_LIBRARIES})
295
296 #IF (NOT PV_INSTALL_NO_DEVELOPMENT)
297 #  # Headers
298 #  GLOB_INSTALL_DEVELOPMENT(
299 #      ${CMAKE_CURRENT_SOURCE_DIR}
300 #      ${PV_INSTALL_INCLUDE_DIR} 
301 #      "*.h;*.hxx;*.txx")
302 #  INSTALL(
303 #      FILES ${dynamicHeaders}
304 #      DESTINATION ${PV_INSTALL_INCLUDE_DIR}
305 #      COMPONENT Development)
306 #  # QT resources
307 #  SET(resPath "${CMAKE_CURRENT_SOURCE_DIR}/Resources/UI")
308 #  GLOB_INSTALL_DEVELOPMENT(
309 #    "${CMAKE_CURRENT_SOURCE_DIR}"
310 #    "${PV_INSTALL_INCLUDE_DIR}/Qt/Widgets/Resources/UI"
311 #    "${resPath}/*.ui")
312 #  SET(resPath "${CMAKE_CURRENT_SOURCE_DIR}/Resources/Icons")
313 #  GLOB_INSTALL_DEVELOPMENT(
314 #    "${CMAKE_CURRENT_SOURCE_DIR}"
315 #    "${PV_INSTALL_INCLUDE_DIR}/Qt/Widgets/Resources/Icons"
316 #    "${resPath}/*.ico;${resPath}/*.png;${resPath}/*.svg;${resPath}/*.xpm;${resPath}/*.rc")
317 #  SET(resPath "${CMAKE_CURRENT_SOURCE_DIR}/Resources")
318 #  GLOB_INSTALL_DEVELOPMENT(
319 #    "${CMAKE_CURRENT_SOURCE_DIR}"
320 #    "${PV_INSTALL_INCLUDE_DIR}/Qt/Widgets/Resources"
321 #    "${resPath}/*.ui;${resPath}/*.ico;${resPath}/*.png;${resPath}/*.svg;${resPath}/*.xpm;${resPath}/*.rc;${resPath}/*.qrc")
322 #ENDIF (NOT PV_INSTALL_NO_DEVELOPMENT)