Commit 0fb557cb authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic '15703-WebKitWidgets-optional'

c9476139 COMP: making Qt WebKit optional
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !801
parents 846f27a9 c9476139
......@@ -4,7 +4,10 @@ add_subdirectory(ImageViewer)
add_subdirectory(SimpleView)
if(TARGET vtkGUISupportQtOpenGL)
add_subdirectory(GraphicsView)
find_package(Qt5 COMPONENTS WebKitWidgets QUIET)
if(Qt5WebKitWidgets_FOUND)
add_subdirectory(GraphicsView)
endif()
endif()
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.ctest.in"
......
......@@ -7,19 +7,24 @@ set(LibSrcs ${QVTKLibSrcs} vtkQtRichTextView.cxx)
set(MocHeaders ${QVTKMocHeaders} vtkQtRichTextView.h)
if(VTK_QT_VERSION VERSION_GREATER "4")
find_package(Qt5 COMPONENTS WebKitWidgets REQUIRED QUIET)
include_directories(${Qt5WebKitWidgets_INCLUDE_DIRS})
add_definitions(${Qt5WebKitWidgets_DEFINITIONS})
find_package(Qt5 COMPONENTS WebKitWidgets QUIET)
if(Qt5WebKitWidgets_FOUND)
include_directories(${Qt5WebKitWidgets_INCLUDE_DIRS})
add_definitions(${Qt5WebKitWidgets_DEFINITIONS})
qt5_wrap_ui(UI_FILES vtkQtRichTextView.ui)
qt5_wrap_cpp(LibMocSrcs ${MocHeaders})
qt5_wrap_ui(UI_FILES vtkQtRichTextView.ui)
qt5_wrap_cpp(LibMocSrcs ${MocHeaders})
set(QT_LIBRARIES ${Qt5WebKitWidgets_LIBRARIES})
set(QT_LIBRARIES ${Qt5WebKitWidgets_LIBRARIES})
# When this module is loaded by an app, load Qt too.
vtk_module_export_code_find_package(Qt5WebKitWidgets)
# When this module is loaded by an app, load Qt too.
vtk_module_export_code_find_package(Qt5WebKitWidgets)
set(_FOUND 1)
else()
message(STATUS "Qt5WebKitWidgets not found. vtkQtRichTextView is disabled.")
endif()
else()
find_package(Qt4 REQUIRED QtCore QtGui QtWebKit QUIET)
find_package(Qt4 COMPONENTS QtCore QtGui QtWebKit QUIET)
# import Qt4 build settings
if(QT_PHONON_FOUND AND APPLE)
......@@ -31,9 +36,14 @@ else()
qt4_wrap_ui(UI_FILES vtkQtRichTextView.ui)
qt4_wrap_cpp(LibMocSrcs ${MocHeaders})
if (QT_WEBKIT_FOUND)
set(_FOUND 1)
endif()
endif()
set(${vtk-module}_NO_HeaderTest 1)
vtk_module_library(${vtk-module} ${LibSrcs} ${UI_FILES} ${LibMocSrcs})
if(${_FOUND})
set(${vtk-module}_NO_HeaderTest 1)
vtk_module_library(${vtk-module} ${LibSrcs} ${UI_FILES} ${LibMocSrcs})
vtk_module_link_libraries(${vtk-module} LINK_PRIVATE ${QT_LIBRARIES})
vtk_module_link_libraries(${vtk-module} LINK_PRIVATE ${QT_LIBRARIES})
endif()
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