Skip to content
Snippets Groups Projects
Commit 32c8ad41 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Ben Boeckel
Browse files

vtkViewsQt: update to the new module system

parent 8fac0335
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,6 @@ set(LibSrcs
vtkQtTreeView.cxx
vtkQtView.cxx
)
set_source_files_properties(vtkQtView.cxx ABSTRACT)
set(MocHeaders
vtkQtAnnotationView.h
vtkQtListView.h
......@@ -19,17 +18,15 @@ set(MocHeaders
vtkQtView.h
)
find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Widgets_DEFINITIONS})
vtk_module_find_package(
PACKAGE Qt5
COMPONENTS Widgets
FORWARD_VERSION_REQ MINOR
VERSION_VAR Qt5_VERSION)
qt5_wrap_cpp(LibMocSrcs ${MocHeaders})
set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
# When this module is loaded by an app, load Qt too.
vtk_module_export_code_find_package(Qt5 COMPONENTS Widgets)
vtk_module_add_module(VTK::ViewsQt
SOURCES ${LibSrcs} ${LibMocSrcs}
HEADERS ${MocHeaders})
set(${vtk-module}_NO_HeaderTest 1)
vtk_module_library(${vtk-module} ${LibSrcs} ${LibMocSrcs})
target_link_libraries(${vtk-module} LINK_PRIVATE ${QT_LIBRARIES})
vtk_module_link(VTK::ViewsQt PRIVATE Qt5::Widgets)
vtk_add_test_cxx(vtkViewsQtCxxTests tests
NO_VALID NO_DATA
TestVtkQtTableView.cxx
)
vtk_test_cxx_executable(vtkViewsQtCxxTests tests)
......@@ -25,15 +25,16 @@
#include "vtkTable.h"
#include "vtkSmartPointer.h"
#include "QTestApp.h"
#include <QWidget>
#include <QApplication>
#include <QTimer>
#define VTK_CREATE(type, name) \
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
int TestVtkQtTableView(int argc, char* argv[])
{
QTestApp app(argc, argv);
QApplication app(argc, argv);
// Create a sphere and create a vtkTable from its point data (normal vectors)
VTK_CREATE(vtkSphereSource, sphereSource);
......@@ -51,7 +52,7 @@ int TestVtkQtTableView(int argc, char* argv[])
tableView->GetWidget()->show();
// Start the Qt event loop to run the application
int status = app.exec();
return status;
QTimer::singleShot(500, &app, SLOT(quit()));
return app.exec();
}
vtk_module(vtkViewsQt
GROUPS
Qt
TEST_DEPENDS
vtkTestingCore
EXCLUDE_FROM_WRAPPING
DEPENDS
vtkCommonCore
vtkGUISupportQt
vtkViewsCore
vtkViewsInfovis
PRIVATE_DEPENDS
vtkCommonDataModel
vtkCommonExecutionModel
vtkFiltersExtraction
vtkFiltersGeneral
vtkInfovisCore
)
NAME
VTK::ViewsQt
LIBRARY_NAME
vtkViewsQt
GROUPS
Qt
DEPENDS
VTK::CommonCore
VTK::GUISupportQt
VTK::ViewsCore
VTK::ViewsInfovis
PRIVATE_DEPENDS
VTK::CommonDataModel
VTK::CommonExecutionModel
VTK::FiltersExtraction
VTK::FiltersGeneral
VTK::InfovisCore
TEST_DEPENDS
VTK::InfovisCore
VTK::TestingCore
EXCLUDE_WRAP
......@@ -75,3 +75,4 @@ private:
};
#endif
// VTK-HeaderTest-Exclude: vtkQtView.h
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment