Commit e358aeba authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Ben Boeckel

vtkGUISupportQtOpenGL: update to the new module system

parent 035ae1d9
include(vtkQt)
set(classes
QVTKGraphicsItem)
set(MocHeaders ${QVTKMocHeaders}
QVTKGraphicsItem.h
)
set(LibSrcs ${QVTKLibSrcs}
QVTKGraphicsItem.cxx
)
if (NOT VTK_LEGACY_REMOVE)
list(APPEND classes
QVTKWidget2)
endif ()
if(NOT VTK_LEGACY_REMOVE)
list(APPEND MocHeaders QVTKWidget2.h)
list(APPEND LibSrcs QVTKWidget2.cxx)
endif()
add_definitions(-DVTK_OPENGL2)
find_package(Qt5 COMPONENTS OpenGL REQUIRED QUIET)
include_directories(${Qt5OpenGL_INCLUDE_DIRS})
add_definitions(${Qt5OpenGL_DEFINITIONS})
qt5_wrap_cpp(LibMocSrcs ${MocHeaders})
set(QT_LIBRARIES ${Qt5OpenGL_LIBRARIES})
# When this module is loaded by an app, load Qt too.
vtk_module_export_code_find_package(Qt5 COMPONENTS OpenGL)
set(${vtk-module}_NO_HeaderTest 1)
vtk_module_library(${vtk-module} ${LibSrcs} ${LibMocSrcs})
include(vtkOpenGL)
vtk_opengl_link(${vtk-module})
vtk_module_link_libraries(${vtk-module} LINK_PRIVATE ${QT_LIBRARIES})
vtk_module_find_package(
PACKAGE Qt5
COMPONENTS OpenGL
FORWARD_VERSION_REQ MINOR
VERSION_VAR Qt5_VERSION)
set(CMAKE_AUTOMOC 1)
vtk_module_add_module(VTK::GUISupportQtOpenGL
CLASSES ${classes})
vtk_module_link(VTK::GUISupportQtOpenGL PUBLIC Qt5::OpenGL)
vtk_module_definitions(VTK::GUISupportQtOpenGL PRIVATE VTK_OPENGL2)
......@@ -8,8 +8,8 @@ qt5_wrap_cpp(moc_srcs QTestMainWindow.h)
vtk_test_cxx_executable(vtkGUISupportQtOpenGLCxxTests tests
QTestMainWindow.cxx
${moc_srcs})
target_link_libraries(vtkGUISupportQtOpenGLCxxTests LINK_PRIVATE
${QT_QTGUI_LIBRARY}
${QT_QTOPENGL_LIBRARY}
${QT_QTWIDGETS_LIBRARY})
target_link_libraries(vtkGUISupportQtOpenGLCxxTests PRIVATE
Qt5::Core
Qt5::Gui
Qt5::Widgets)
endif()
vtk_module(vtkGUISupportQtOpenGL
TEST_DEPENDS
vtkTestingCore
vtkTestingRendering
vtkFiltersSources
EXCLUDE_FROM_WRAPPING
DEPENDS
vtkCommonCore
vtkRenderingOpenGL2
PRIVATE_DEPENDS
vtkGUISupportQt
vtkInteractionStyle
)
NAME
VTK::GUISupportQtOpenGL
LIBRARY_NAME
vtkGUISupportQtOpenGL
DEPENDS
VTK::CommonCore
VTK::RenderingOpenGL2
VTK::GUISupportQt
PRIVATE_DEPENDS
VTK::InteractionStyle
VTK::opengl
TEST_DEPENDS
VTK::FiltersSources
VTK::TestingCore
VTK::TestingRendering
EXCLUDE_WRAP
......@@ -5,11 +5,9 @@ vtk_add_test_cxx(vtkGUISupportQtSQLCxxTests tests
TestQtSQLDatabase.cxx
)
find_package(Qt5 COMPONENTS Widgets REQUIRED)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${Qt5Widgets_DEFINITIONS})
find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
vtk_test_cxx_executable(vtkGUISupportQtSQLCxxTests tests)
set_target_properties(vtkGUISupportQtSQLCxxTests PROPERTIES
COMPILE_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
target_link_libraries(vtkGUISupportQtSQLCxxTests
PRIVATE
Qt5::Widgets)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment