PROJECT(pqComponents)

IF(PARAVIEW_ENABLE_PYTHON)
  FIND_PACKAGE(PythonLibs)

  SET(PYTHON_LINK_LIBRARIES
    vtkPVPythonInterpretor
    QtPython
    vtkPVServerCommonPythonD
    vtkPVServerManagerPythonD
    ${PYTHON_LIBRARIES}
  )

  INCLUDE_DIRECTORIES(
    ${VTKPythonWrapping_SOURCE_DIR}/Executable
  )

ENDIF(PARAVIEW_ENABLE_PYTHON)

INCLUDE_DIRECTORIES(
  ${QtPython_BINARY_DIR}
  ${QtPython_SOURCE_DIR}
  ${pqComponents_BINARY_DIR}
  ${pqComponents_SOURCE_DIR}
  ${pqCore_BINARY_DIR}
  ${pqCore_SOURCE_DIR}
  ${VTK_INCLUDE_DIR}
  ${PARAVIEW_INCLUDE_DIRS}
  ${ParaView_SOURCE_DIR}/VTK/GUISupport/Qt
  ${QtChart_SOURCE_DIR}
  ${QtChart_BINARY_DIR}
  ${QtTesting_SOURCE_DIR}
  ${QtTesting_BINARY_DIR}
  ${QtWidgets_SOURCE_DIR}
  ${QtWidgets_BINARY_DIR}
)

SET(MOC_INCLUDE_DIRS ${MOC_INCLUDE_DIRS} ${QT_INCLUDE_DIR})

# Reduce the number of dirs that get included on moc command line
# since it causes issues on Windows 2000.
GET_DIRECTORY_PROPERTY(include_dirs_tmp INCLUDE_DIRECTORIES)
SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${MOC_INCLUDE_DIRS}")

QT4_WRAP_CPP(MOC_BUILT_SOURCES
  pq3DViewPropertiesWidget.h
  pq3DWidget.h
  pqActiveView.h
  pqActiveServer.h
  pqAddSourceDialog.h
  pqAnimationManager.h
  pqAnimationPanel.h
  pqAutoGeneratedObjectPanel.h
  pqBarChartDisplayProxyEditor.h
  pqCalculatorPanel.h
  pqClipPanel.h
  pqColorPresetManager.h
  pqColorPresetModel.h
  pqColorScaleEditor.h
  pqComboBoxDomain.h
  pqContourPanel.h
  pqCreateServerStartupDialog.h
  pqCustomFilterDefinitionWizard.h
  pqCustomFilterManager.h
  pqCustomFilterManagerModel.h
  pqCutPanel.h
  pqDataInformationModel.h
  pqDataInformationModelSelectionAdaptor.h
  pqDataInformationWidget.h
  pqDataSetModel.h
  pqDialog.h
  pqDisplayColorWidget.h
  pqDisplayPanel.h
  pqDisplayProxyEditor.h
  pqDisplayProxyEditorWidget.h
  pqDisplayRepresentationWidget.h
  pqDoubleRangeWidgetDomain.h
  pqDoubleSpinBoxDomain.h
  pqEditServerStartupDialog.h
  pqElementInspectorWidget.h
  pqEnterIdsDialog.h
  pqEnterPointsDialog.h
  pqEnterThresholdsDialog.h
  pqExodusIIPanel.h
  pqExodusPanel.h
  pqExtractLocationsPanel.h
  pqExtractSelectionPanel.h
  pqFileChooserWidget.h
  pqFilterInputDialog.h
  pqFieldSelectionAdaptor.h
  pqHandleWidget.h
  pqImageTip.h
  pqImplicitPlaneWidget.h
  pqKeyFrameTimeValidator.h
  pqLineSourceWidget.h
  pqLineWidget.h
  pqLinksEditor.h
  pqLinksManager.h
  pqLoadedFormObjectPanel.h
  pqLookmarkDefinitionWizard.h
  pqLookmarkBrowser.h
  pqLookmarkBrowserModel.h
  pqLookmarkInspector.h
  pqLookmarkManagerModel.h
  pqLookmarkModel.h
  pqLookmarkSourceDialog.h
  pqMainWindowCore.h
  pqMultiView.h
  pqMultiViewFrame.h
  pqNamedObjectPanel.h
  pqObjectInspectorDriver.h
  pqObjectInspectorWidget.h
  pqObjectPanel.h
  pqParticleTracerPanel.h
  pqPQLookupTableManager.h
  pqPipelineBrowser.h
  pqPipelineBrowserContextMenu.h
  pqPipelineBrowserStateManager.h
  pqPipelineMenu.h
  pqPipelineModel.h
  pqPipelineModelSelectionAdaptor.h
  pqPluginDialog.h
  pqPointSourceWidget.h
  pqProxyInformationWidget.h
  pqProxyPanel.h
  pqProxySelectionWidget.h
  pqProxyTabWidget.h
  pqRecentFilesMenu.h
  pqRescaleRange.h
  pqSMSignalAdaptors.h
  pqSampleScalarAddRangeDialog.h
  pqSampleScalarWidget.h
  pqScalarSetModel.h
  pqSelectReaderDialog.h
  pqSelectionAdaptor.h
  pqSelectionManager.h
  pqServerBrowser.h
  pqServerStartupBrowser.h
  pqServerStartupDialog.h
  pqSettingsDialog.h
  pqSignalAdaptorKeyFrameValue.h
  pqSignalAdaptorKeyFrameTime.h
  pqSignalAdaptorKeyFrameType.h
  pqSignalAdaptorSelectionTreeWidget.h
  pqSignalAdaptorTreeWidget.h
  pqSimpleServerStartup.h
  pqSliderDomain.h
  pqSourceHistoryModel.h
  pqSourceInfoFilterModel.h
  pqSourceInfoGroupMap.h
  pqSourceInfoIcons.h
  pqSourceInfoModel.h
  pqSpinBoxDomain.h
  pqStreamTracerPanel.h
  pqTextDisplayPropertiesWidget.h
  pqThresholdPanel.h
  pqTimerLogDisplay.h
  pqToolTipTrapper.h
  pqVCRController.h
  pqViewManager.h
  pqXDMFPanel.h
  pqXYPlotDisplayProxyEditor.h
)
SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${include_dirs_tmp}")

SET(UI_FORMS
  Resources/UI/pq3DViewPropertiesWidget.ui
  Resources/UI/pqAbortAnimation.ui
  Resources/UI/pqAddSourceDialog.ui
  Resources/UI/pqAnimationPanel.ui
  Resources/UI/pqAnimationSettings.ui
  Resources/UI/pqBarChartDisplayEditor.ui
  Resources/UI/pqCalculatorPanel.ui
  Resources/UI/pqColorPresetDialog.ui
  Resources/UI/pqColorScaleDialog.ui
  Resources/UI/pqContourControls.ui
  Resources/UI/pqCreateServerStartupDialog.ui
  Resources/UI/pqCustomFilterDefinitionWizard.ui
  Resources/UI/pqCustomFilterManager.ui
  Resources/UI/pqDisplayProxyEditor.ui
  Resources/UI/pqDisplayProxyEditorWidget.ui
  Resources/UI/pqDisplayRepresentationWidget.ui
  Resources/UI/pqEditServerStartupDialog.ui
  Resources/UI/pqElementInspectorWidget.ui
  Resources/UI/pqEmptyView.ui
  Resources/UI/pqEnterIdsDialog.ui
  Resources/UI/pqEnterPointsDialog.ui
  Resources/UI/pqEnterThresholdsDialog.ui
  Resources/UI/pqExodusIIPanel.ui
  Resources/UI/pqExodusPanel.ui
  Resources/UI/pqExtractLocationsPanel.ui
  Resources/UI/pqExtractSelectionPanel.ui
  Resources/UI/pqHandleWidget.ui
  Resources/UI/pqImplicitPlaneWidget.ui
  Resources/UI/pqLineSourceControls.ui
  Resources/UI/pqLineWidget.ui
  Resources/UI/pqLineSourceControls.ui
  Resources/UI/pqLinksEditor.ui
  Resources/UI/pqLinksManager.ui
  Resources/UI/pqLookmarkDefinitionWizard.ui
  Resources/UI/pqLookmarkBrowser.ui
  Resources/UI/pqLookmarkInspector.ui
  Resources/UI/pqMultiViewFrameMenu.ui
  Resources/UI/pqParticleTracerPanel.ui
  Resources/UI/pqPluginDialog.ui
  Resources/UI/pqPointSourceControls.ui
  Resources/UI/pqProxyInformationWidget.ui
  Resources/UI/pqRescaleRangeDialog.ui
  Resources/UI/pqSampleScalarAddRangeDialog.ui
  Resources/UI/pqSampleScalarWidget.ui
  Resources/UI/pqSelectReaderDialog.ui
  Resources/UI/pqServerBrowser.ui
  Resources/UI/pqServerStartupDialog.ui
  Resources/UI/pqSettingsDialog.ui
  Resources/UI/pqSignalAdaptorKeyFrameValue.ui
  Resources/UI/pqSignalAdaptorKeyFrameType.ui
  Resources/UI/pqStreamTracerPanel.ui
  Resources/UI/pqTextDisplayPropertiesWidget.ui
  Resources/UI/pqTimerLogDisplay.ui
  Resources/UI/pqXDMFPanel.ui
  Resources/UI/pqXYPlotDisplayEditor.ui
)

QT4_WRAP_UI(UI_BUILT_SOURCES
  ${UI_FORMS}
)

SET(STANDARD_GUI_RESOURCES
  ${CMAKE_CURRENT_SOURCE_DIR}/Resources/XML/ParaViewWriters.xml
  ${CMAKE_CURRENT_SOURCE_DIR}/Resources/XML/ParaViewReaders.xml 
  ${CMAKE_CURRENT_SOURCE_DIR}/Resources/XML/ParaViewFilters.xml
  ${CMAKE_CURRENT_SOURCE_DIR}/Resources/XML/ParaViewSources.xml
 )
SET(ALL_GUI_RESOURCES
  ${STANDARD_GUI_RESOURCES}
  ${PARAVIEW_EXTRA_GUI_RESOURCES}
  )

SET(QT_COMPONENTS_GUI_RESOURCES_CONTENTS)
FOREACH(RESOURCE ${ALL_GUI_RESOURCES})
  GET_FILENAME_COMPONENT(ALIAS ${RESOURCE} NAME)
  FILE(RELATIVE_PATH RESOURCE ${CMAKE_CURRENT_BINARY_DIR} "${RESOURCE}")
  FILE(TO_NATIVE_PATH "${RESOURCE}" RESOURCE)
  SET(QT_COMPONENTS_GUI_RESOURCES_CONTENTS 
      "${QT_COMPONENTS_GUI_RESOURCES_CONTENTS}  <file alias=\"${ALIAS}\">${RESOURCE}</file>\n")
ENDFOREACH(RESOURCE)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/pqExtraResources.qrc.in"
               "${CMAKE_CURRENT_BINARY_DIR}/pqExtraResources.qrc" @ONLY)

SET(UI_RESOURCES
  Resources/pqComponents.qrc
  "${CMAKE_CURRENT_BINARY_DIR}/pqExtraResources.qrc"
)

QT4_ADD_RESOURCES(RCS_SOURCES
  ${UI_RESOURCES}
)


SOURCE_GROUP("Resources" FILES
  ${UI_RESOURCES}
  ${UI_FORMS}
)

SOURCE_GROUP("Generated" FILES
  ${MOC_BUILT_SOURCES}
  ${RCS_SOURCES}
  ${UI_BUILT_SOURCES}
)

ADD_LIBRARY(pqComponents
  pq3DViewPropertiesWidget.cxx
  pq3DViewPropertiesWidget.h
  pq3DWidget.cxx
  pq3DWidget.h
  pqActiveView.cxx
  pqActiveView.h
  pqActiveServer.cxx
  pqActiveServer.h
  pqAddSourceDialog.cxx
  pqAddSourceDialog.h
  pqAnimationManager.cxx
  pqAnimationManager.h
  pqAnimationPanel.cxx
  pqAnimationPanel.h
  pqAutoGeneratedObjectPanel.cxx
  pqAutoGeneratedObjectPanel.h
  pqBarChartDisplayProxyEditor.cxx
  pqBarChartDisplayProxyEditor.h
  pqCalculatorPanel.cxx
  pqCalculatorPanel.h
  pqClipPanel.cxx
  pqClipPanel.h
  pqCloseViewUndoElement.cxx
  pqCloseViewUndoElement.h
  pqColorPresetManager.cxx
  pqColorPresetManager.h
  pqColorPresetModel.cxx
  pqColorPresetModel.h
  pqColorScaleEditor.cxx
  pqColorScaleEditor.h
  pqComboBoxDomain.cxx
  pqComboBoxDomain.h
  pqComponentsExport.h
  pqComponentsInit.cxx
  pqComponentsInit.h
  pqContourPanel.cxx
  pqContourPanel.h
  pqCreateServerStartupDialog.cxx
  pqCreateServerStartupDialog.h
  pqCustomFilterDefinitionModel.cxx
  pqCustomFilterDefinitionModel.h
  pqCustomFilterDefinitionWizard.cxx
  pqCustomFilterDefinitionWizard.h
  pqCustomFilterManager.cxx
  pqCustomFilterManager.h
  pqCustomFilterManagerModel.cxx
  pqCustomFilterManagerModel.h
  pqCutPanel.cxx
  pqCutPanel.h
  pqDataInformationModel.cxx
  pqDataInformationModel.h
  pqDataInformationModelSelectionAdaptor.cxx
  pqDataInformationModelSelectionAdaptor.h
  pqDataInformationWidget.cxx
  pqDataInformationWidget.h
  pqDataSetModel.cxx
  pqDataSetModel.h
  pqDialog.cxx
  pqDialog.h
  pqDisplayColorWidget.cxx
  pqDisplayColorWidget.h
  pqDisplayPanel.cxx
  pqDisplayPanel.h
  pqDisplayProxyEditor.cxx
  pqDisplayProxyEditor.h
  pqDisplayProxyEditorWidget.h
  pqDisplayProxyEditorWidget.cxx
  pqDisplayRepresentationWidget.cxx
  pqDisplayRepresentationWidget.h
  pqDoubleRangeWidgetDomain.cxx
  pqDoubleRangeWidgetDomain.h
  pqDoubleSpinBoxDomain.cxx
  pqDoubleSpinBoxDomain.h
  pqEditServerStartupDialog.cxx
  pqEditServerStartupDialog.h
  pqElementInspectorWidget.cxx
  pqElementInspectorWidget.h
  pqEnterIdsDialog.cxx
  pqEnterIdsDialog.h
  pqEnterPointsDialog.cxx
  pqEnterPointsDialog.h
  pqEnterThresholdsDialog.cxx
  pqEnterThresholdsDialog.h
  pqExodusIIPanel.cxx
  pqExodusIIPanel.h
  pqExodusPanel.cxx
  pqExodusPanel.h
  pqExtractLocationsPanel.cxx
  pqExtractLocationsPanel.h
  pqExtractSelectionPanel.cxx
  pqExtractSelectionPanel.h
  pqFileChooserWidget.cxx
  pqFileChooserWidget.h
  pqFilterInputDialog.cxx
  pqFilterInputDialog.h
  pqFieldSelectionAdaptor.cxx
  pqFieldSelectionAdaptor.h
  pqHandleWidget.cxx
  pqHandleWidget.h
  pqImageTip.cxx
  pqImageTip.h
  pqImplicitPlaneWidget.cxx
  pqImplicitPlaneWidget.h
  pqKeyFrameTimeValidator.cxx
  pqKeyFrameTimeValidator.h
  pqLineSourceWidget.cxx
  pqLineSourceWidget.h
  pqLineWidget.cxx
  pqLineWidget.h
  pqLinksEditor.cxx
  pqLinksEditor.h
  pqLinksManager.cxx
  pqLinksManager.h
  pqLoadedFormObjectPanel.cxx
  pqLoadedFormObjectPanel.h
  pqLookmarkBrowser.cxx
  pqLookmarkBrowser.h
  pqLookmarkBrowserModel.cxx
  pqLookmarkBrowserModel.h
  pqLookmarkDefinitionWizard.cxx
  pqLookmarkDefinitionWizard.h
  pqLookmarkInspector.cxx
  pqLookmarkInspector.h
  pqLookmarkManagerModel.cxx
  pqLookmarkManagerModel.h
  pqLookmarkModel.cxx
  pqLookmarkModel.h
  pqLookmarkSourceDialog.cxx
  pqLookmarkSourceDialog.h
  pqLookmarkStateLoader.cxx
  pqLookmarkStateLoader.h
  pqMainWindowCore.cxx
  pqMainWindowCore.h
  pqMultiView.cxx
  pqMultiView.h
  pqMultiViewFrame.cxx
  pqMultiViewFrame.h
  pqNamedObjectPanel.cxx
  pqNamedObjectPanel.h
  pqNamedWidgets.cxx
  pqNamedWidgets.h
  pqObjectInspectorDriver.cxx
  pqObjectInspectorDriver.h
  pqObjectInspectorWidget.cxx
  pqObjectInspectorWidget.h
  pqObjectPanel.cxx
  pqObjectPanel.h
  pqPQLookupTableManager.cxx
  pqPQLookupTableManager.h
  pqParticleTracerPanel.cxx
  pqParticleTracerPanel.h
  pqPipelineBrowser.cxx
  pqPipelineBrowser.h
  pqPipelineBrowserContextMenu.cxx
  pqPipelineBrowserContextMenu.h
  pqPipelineBrowserStateManager.cxx
  pqPipelineBrowserStateManager.h
  pqPipelineMenu.cxx
  pqPipelineMenu.h
  pqPipelineModel.cxx
  pqPipelineModel.h
  pqPipelineModelSelectionAdaptor.cxx
  pqPipelineModelSelectionAdaptor.h
  pqPluginDialog.cxx
  pqPluginDialog.h
  pqPointSourceWidget.cxx
  pqPointSourceWidget.h
  pqProxyInformationWidget.cxx
  pqProxyInformationWidget.h
  pqProxyPanel.cxx
  pqProxyPanel.h
  pqProxySelectionWidget.cxx
  pqProxySelectionWidget.h
  pqProxyTabWidget.cxx
  pqProxyTabWidget.h
  pqRecentFilesMenu.cxx
  pqRecentFilesMenu.h
  pqRescaleRange.cxx
  pqRescaleRange.h
  pqSMSignalAdaptors.cxx
  pqSMSignalAdaptors.h
  pqSampleScalarAddRangeDialog.cxx
  pqSampleScalarAddRangeDialog.h
  pqSampleScalarWidget.cxx
  pqSampleScalarWidget.h
  pqScalarSetModel.cxx
  pqScalarSetModel.h
  pqSelectReaderDialog.cxx
  pqSelectReaderDialog.h
  pqSelectionAdaptor.cxx
  pqSelectionAdaptor.h
  pqSelectionManager.cxx
  pqSelectionManager.h
  pqServerBrowser.cxx
  pqServerBrowser.h
  pqServerStartupBrowser.cxx
  pqServerStartupBrowser.h
  pqServerStartupDialog.cxx
  pqServerStartupDialog.h
  pqSettingsDialog.cxx
  pqSettingsDialog.h
  pqSignalAdaptorKeyFrameValue.cxx
  pqSignalAdaptorKeyFrameValue.h
  pqSignalAdaptorKeyFrameTime.cxx
  pqSignalAdaptorKeyFrameTime.h
  pqSignalAdaptorKeyFrameType.cxx
  pqSignalAdaptorKeyFrameType.h
  pqSignalAdaptorSelectionTreeWidget.cxx
  pqSignalAdaptorSelectionTreeWidget.h
  pqSignalAdaptorTreeWidget.cxx
  pqSignalAdaptorTreeWidget.h
  pqSimpleServerStartup.cxx
  pqSimpleServerStartup.h
  pqSliderDomain.cxx
  pqSliderDomain.h
  pqSourceHistoryModel.cxx
  pqSourceHistoryModel.h
  pqSourceInfoFilterModel.cxx
  pqSourceInfoFilterModel.h
  pqSourceInfoGroupMap.cxx
  pqSourceInfoGroupMap.h
  pqSourceInfoIcons.cxx
  pqSourceInfoIcons.h
  pqSourceInfoModel.cxx
  pqSourceInfoModel.h
  pqSourceProxyInfo.cxx
  pqSourceProxyInfo.h
  pqSpinBoxDomain.cxx
  pqSpinBoxDomain.h
  pqSplitViewUndoElement.cxx
  pqSplitViewUndoElement.h
  pqStateLoader.cxx
  pqStateLoader.h
  pqStreamTracerPanel.cxx
  pqStreamTracerPanel.h
  pqTextDisplayPropertiesWidget.cxx
  pqTextDisplayPropertiesWidget.h
  pqThresholdPanel.cxx
  pqThresholdPanel.h
  pqTimerLogDisplay.cxx
  pqTimerLogDisplay.h
  pqToolTipTrapper.cxx
  pqToolTipTrapper.h
  pqUndoStackBuilder.cxx
  pqUndoStackBuilder.h
  pqVariableType.h
  pqVCRController.cxx
  pqVCRController.h
  pqViewManager.cxx
  pqViewManager.h
  pqXDMFPanel.cxx
  pqXDMFPanel.h
  pqXYPlotDisplayProxyEditor.cxx
  pqXYPlotDisplayProxyEditor.h
  ${MOC_BUILT_SOURCES}
  ${RCS_SOURCES}
  ${UI_BUILT_SOURCES}
)


TARGET_LINK_LIBRARIES(pqComponents
  pqCore
  QtChart
  QtTesting
  pqWidgets
  QVTK
  vtkPVServerManager
  ${PYTHON_LINK_LIBRARIES}
)


INSTALL(TARGETS pqComponents
  RUNTIME DESTINATION ${PV_INSTALL_BIN_DIR_CM24} COMPONENT Runtime
  LIBRARY DESTINATION ${PV_INSTALL_LIB_DIR_CM24} COMPONENT Runtime
  ARCHIVE DESTINATION ${PV_INSTALL_LIB_DIR_CM24} COMPONENT Development)
