From 54e43bf38f7b8af1fa1bfc934a27f2443fe304d2 Mon Sep 17 00:00:00 2001 From: Todd Date: Mon, 11 Jun 2018 15:40:00 -0400 Subject: [PATCH 1/8] Use `target_link_libraries` instead of `qt5_use_modules`. diff --git a/Examples/GUI/Qt/Events/CMakeLists.txt b/Examples/GUI/Qt/Events/CMakeLists.txt --- a/Examples/GUI/Qt/Events/CMakeLists.txt +++ b/Examples/GUI/Qt/Events/CMakeLists.txt @@ -43,7 +43,7 @@ add_executable(qtevents MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs}) - qt5_use_modules(qtevents Core Gui Widgets) + target_link_libraries(qtevents Qt5::Core Qt5::Gui Qt5::Widgets) target_link_libraries(qtevents ${VTK_LIBRARIES}) else() find_package(Qt4 REQUIRED) diff --git a/Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt b/Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt --- a/Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt +++ b/Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt @@ -46,7 +46,7 @@ # CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped. add_executable(QtVTKRenderWindows ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs}) - qt5_use_modules(QtVTKRenderWindows Core Gui Widgets) + target_link_libraries(QtVTKRenderWindows Qt5::Core Qt5::Gui Qt5::Widgets) target_link_libraries(QtVTKRenderWindows ${VTK_LIBRARIES}) else() find_package(Qt4 REQUIRED) diff --git a/Examples/GUI/Qt/GraphicsView/CMakeLists.txt b/Examples/GUI/Qt/GraphicsView/CMakeLists.txt --- a/Examples/GUI/Qt/GraphicsView/CMakeLists.txt +++ b/Examples/GUI/Qt/GraphicsView/CMakeLists.txt @@ -61,8 +61,9 @@ add_executable(qtgraphicsview MACOSX_BUNDLE ${Srcs} ${Hdrs} ${MOC_Hdrs} ${QRC_Srcs}) - qt5_use_modules(qtgraphicsview Core Gui Widgets - WebKit WebKitWidgets OpenGL OpenGLExtensions) + target_link_libraries(qtgraphicsview Qt5::Core Qt5::Gui Qt5::Widgets + Qt5::WebKit Qt5::WebKitWidgets + Qt5::OpenGL Qt5::OpenGLExtensions) target_link_libraries(qtgraphicsview ${VTK_LIBRARIES}) else() find_package(Qt4 REQUIRED) diff --git a/Examples/GUI/Qt/ImageViewer/CMakeLists.txt b/Examples/GUI/Qt/ImageViewer/CMakeLists.txt --- a/Examples/GUI/Qt/ImageViewer/CMakeLists.txt +++ b/Examples/GUI/Qt/ImageViewer/CMakeLists.txt @@ -21,6 +21,6 @@ find_package(Qt5 COMPONENTS Core REQUIRED QUIET) add_executable(qtimageviewer ${Srcs}) - qt5_use_modules(qtimageviewer Core Gui Widgets) + target_link_libraries(qtimageviewer Qt5::Core Qt5::Gui Qt5::Widgets) target_link_libraries(qtimageviewer ${VTK_LIBRARIES}) endif() diff --git a/Examples/GUI/Qt/SimpleView/CMakeLists.txt b/Examples/GUI/Qt/SimpleView/CMakeLists.txt --- a/Examples/GUI/Qt/SimpleView/CMakeLists.txt +++ b/Examples/GUI/Qt/SimpleView/CMakeLists.txt @@ -64,7 +64,7 @@ add_executable(SimpleView MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${QRC_Srcs}) - qt5_use_modules(SimpleView Core Gui Widgets) + target_link_libraries(SimpleView Qt5::Core Qt5::Gui Qt5::Widgets) target_link_libraries(SimpleView ${VTK_LIBRARIES}) else() find_package(Qt4 REQUIRED) diff --git a/Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt b/Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt --- a/Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt +++ b/Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt @@ -65,7 +65,7 @@ add_executable(CustomLinkView MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs}) - qt5_use_modules(CustomLinkView Core Gui Widgets) + target_link_libraries(CustomLinkView Qt5::Core Qt5::Gui Qt5::Widgets) target_link_libraries(CustomLinkView ${VTK_LIBRARIES}) else() diff --git a/Examples/Infovis/Cxx/EasyView/CMakeLists.txt b/Examples/Infovis/Cxx/EasyView/CMakeLists.txt --- a/Examples/Infovis/Cxx/EasyView/CMakeLists.txt +++ b/Examples/Infovis/Cxx/EasyView/CMakeLists.txt @@ -74,7 +74,7 @@ add_executable(EasyView MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs}) - qt5_use_modules(EasyView Core Gui Widgets) + target_link_libraries(EasyView Qt5::Core Qt5::Gui Qt5::Widgets) target_link_libraries(EasyView ${VTK_LIBRARIES}) else() diff --git a/Examples/Infovis/Cxx/StatsView/CMakeLists.txt b/Examples/Infovis/Cxx/StatsView/CMakeLists.txt --- a/Examples/Infovis/Cxx/StatsView/CMakeLists.txt +++ b/Examples/Infovis/Cxx/StatsView/CMakeLists.txt @@ -62,7 +62,7 @@ add_executable(StatsView MACOSX_BUNDLE ${Srcs} ${Hdrs} ${UI_Srcs} ${MOC_Hdrs} ${Rcs_Srcs}) - qt5_use_modules(StatsView Core Gui Widgets) + target_link_libraries(StatsView Qt5::Core Qt5::Gui Qt5::Widgets) target_link_libraries(StatsView ${VTK_LIBRARIES}) else()