From e1fe01a6002980b087623a6c67ffce07bffc5dd5 Mon Sep 17 00:00:00 2001
From: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Date: Wed, 27 Jul 2016 17:56:06 -0400
Subject: [PATCH] Cleanup QT5.

In module configuration files generated for Qt-based modules, we now
export find_package() calls that find specific components from Qt5 i.e.
`find_package(Qt5 COMPONENTS Widgets)` instead of
`find_package(Qt5Widgets)`.
---
 GUISupport/Qt/CMakeLists.txt       | 2 +-
 GUISupport/QtOpenGL/CMakeLists.txt | 2 +-
 GUISupport/QtSQL/CMakeLists.txt    | 3 +--
 GUISupport/QtWebkit/CMakeLists.txt | 2 +-
 Rendering/Qt/CMakeLists.txt        | 2 +-
 Views/Qt/CMakeLists.txt            | 2 +-
 6 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/GUISupport/Qt/CMakeLists.txt b/GUISupport/Qt/CMakeLists.txt
index 247a89d041..e362e59b38 100644
--- a/GUISupport/Qt/CMakeLists.txt
+++ b/GUISupport/Qt/CMakeLists.txt
@@ -75,7 +75,7 @@ if(VTK_QT_VERSION VERSION_GREATER "4")
   set(QT_LIBRARIES_PRIVATE ${Qt5X11Extras_LIBRARIES})
 
   # When this module is loaded by an app, load Qt too.
-  vtk_module_export_code_find_package(Qt5Widgets)
+  vtk_module_export_code_find_package(Qt5 COMPONENTS Widgets)
 else()
   # import Qt4 build settings
   set(QT_USE_QTNETWORK 1)
diff --git a/GUISupport/QtOpenGL/CMakeLists.txt b/GUISupport/QtOpenGL/CMakeLists.txt
index 22356f767a..c876e10e67 100644
--- a/GUISupport/QtOpenGL/CMakeLists.txt
+++ b/GUISupport/QtOpenGL/CMakeLists.txt
@@ -22,7 +22,7 @@ if(VTK_QT_VERSION VERSION_GREATER "4")
   set(QT_LIBRARIES ${Qt5OpenGL_LIBRARIES})
 
   # When this module is loaded by an app, load Qt too.
-  vtk_module_export_code_find_package(Qt5OpenGL)
+  vtk_module_export_code_find_package(Qt5 COMPONENTS OpenGL)
 else()
   # import Qt4 build settings
   set(QT_USE_QTOPENGL 1)
diff --git a/GUISupport/QtSQL/CMakeLists.txt b/GUISupport/QtSQL/CMakeLists.txt
index 5c9c987242..493c1ebde6 100644
--- a/GUISupport/QtSQL/CMakeLists.txt
+++ b/GUISupport/QtSQL/CMakeLists.txt
@@ -24,8 +24,7 @@ if(VTK_QT_VERSION VERSION_GREATER "4")
   set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5Sql_LIBRARIES})
 
   # When this module is loaded by an app, load Qt too.
-  vtk_module_export_code_find_package(Qt5Widgets)
-  vtk_module_export_code_find_package(Qt5Sql)
+  vtk_module_export_code_find_package(Qt5 COMPONENTS Sql Widgets)
 else()
   # import Qt4 build settings
   set(QT_USE_QTSQL 1)
diff --git a/GUISupport/QtWebkit/CMakeLists.txt b/GUISupport/QtWebkit/CMakeLists.txt
index 3e2e71414f..8492a7aeb9 100644
--- a/GUISupport/QtWebkit/CMakeLists.txt
+++ b/GUISupport/QtWebkit/CMakeLists.txt
@@ -18,7 +18,7 @@ if(VTK_QT_VERSION VERSION_GREATER "4")
     set(QT_LIBRARIES ${Qt5WebKitWidgets_LIBRARIES})
 
     # When this module is loaded by an app, load Qt too.
-    vtk_module_export_code_find_package(Qt5WebKitWidgets)
+    vtk_module_export_code_find_package(Qt5 COMPONENTS WebKitWidgets)
     set(_FOUND 1)
   else()
     message(STATUS "Qt5WebKitWidgets not found. vtkQtRichTextView is disabled.")
diff --git a/Rendering/Qt/CMakeLists.txt b/Rendering/Qt/CMakeLists.txt
index b91fc2ed2a..eb66fe7cb4 100644
--- a/Rendering/Qt/CMakeLists.txt
+++ b/Rendering/Qt/CMakeLists.txt
@@ -15,7 +15,7 @@ if(VTK_QT_VERSION VERSION_GREATER "4")
   set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
 
   # When this module is loaded by an app, load Qt too.
-  vtk_module_export_code_find_package(Qt5Widgets)
+  vtk_module_export_code_find_package(Qt5 COMPONENTS Widgets)
 else()
   # import Qt4 build settings
   find_package(Qt4 REQUIRED QtCore QtGui QUIET)
diff --git a/Views/Qt/CMakeLists.txt b/Views/Qt/CMakeLists.txt
index a356788d30..eb6996eaec 100644
--- a/Views/Qt/CMakeLists.txt
+++ b/Views/Qt/CMakeLists.txt
@@ -29,7 +29,7 @@ if(VTK_QT_VERSION VERSION_GREATER "4")
   set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
 
   # When this module is loaded by an app, load Qt too.
-  vtk_module_export_code_find_package(Qt5Widgets)
+  vtk_module_export_code_find_package(Qt5 COMPONENTS Widgets)
 else()
   # import Qt4 build settings
   set(QT_USE_QTNETWORK 1)
-- 
GitLab