File Fix-build-with-Qt-511.patch of Package avogadrolibs

commit 03dd55beb878b5e15d891535a3c8b7ffa6133c92
Author: Andreas Sturmlechner <asturm@gentoo.org>
Date:   Tue Apr 17 11:31:22 2018 +0200

    Fix build with Qt 5.11_beta3 (dropping qt5_use_modules)

diff --git a/avogadro/molequeue/CMakeLists.txt b/avogadro/molequeue/CMakeLists.txt
index 987763b..38d872c 100644
--- a/avogadro/molequeue/CMakeLists.txt
+++ b/avogadro/molequeue/CMakeLists.txt
@@ -42,6 +42,5 @@ qt5_wrap_ui(UI_SOURCES ${UIS})
 list(APPEND SOURCES ${UI_SOURCES})
 
 avogadro_add_library(AvogadroMoleQueue ${HEADERS} ${SOURCES})
-qt5_use_modules(AvogadroMoleQueue Widgets Network)
 set_target_properties(AvogadroMoleQueue PROPERTIES AUTOMOC TRUE)
-target_link_libraries(AvogadroMoleQueue AvogadroQtGui MoleQueueClient)
+target_link_libraries(AvogadroMoleQueue AvogadroQtGui MoleQueueClient Qt5::Widgets Qt5::Network)
diff --git a/avogadro/qtgui/CMakeLists.txt b/avogadro/qtgui/CMakeLists.txt
index 550ae42..586dac4 100644
--- a/avogadro/qtgui/CMakeLists.txt
+++ b/avogadro/qtgui/CMakeLists.txt
@@ -89,5 +89,4 @@ qt5_add_resources(RC_SOURCES ${RCS})
 list(APPEND SOURCES ${RC_SOURCES})
 
 avogadro_add_library(AvogadroQtGui ${HEADERS} ${SOURCES})
-qt5_use_modules(AvogadroQtGui Widgets)
-target_link_libraries(AvogadroQtGui AvogadroIO)
+target_link_libraries(AvogadroQtGui AvogadroIO Qt5::Widgets)
diff --git a/avogadro/qtopengl/CMakeLists.txt b/avogadro/qtopengl/CMakeLists.txt
index ca53fbf..102c74a 100644
--- a/avogadro/qtopengl/CMakeLists.txt
+++ b/avogadro/qtopengl/CMakeLists.txt
@@ -16,5 +16,4 @@ set(SOURCES
 )
 
 avogadro_add_library(AvogadroQtOpenGL ${HEADERS} ${SOURCES})
-qt5_use_modules(AvogadroQtOpenGL OpenGL)
-target_link_libraries(AvogadroQtOpenGL AvogadroRendering AvogadroQtGui)
+target_link_libraries(AvogadroQtOpenGL AvogadroRendering AvogadroQtGui Qt5::OpenGL)
diff --git a/avogadro/vtk/CMakeLists.txt b/avogadro/vtk/CMakeLists.txt
index 50ca215..733bdab 100644
--- a/avogadro/vtk/CMakeLists.txt
+++ b/avogadro/vtk/CMakeLists.txt
@@ -30,8 +30,7 @@ set(SOURCES
 )
 
 avogadro_add_library(AvogadroVtk ${HEADERS} ${SOURCES})
-qt5_use_modules(AvogadroVtk OpenGL)
 set_target_properties(AvogadroVtk PROPERTIES AUTOMOC TRUE)
 target_link_libraries(AvogadroVtk AvogadroRendering AvogadroQtGui
   vtkRenderingOpenGL vtkGUISupportQtOpenGL vtkRenderingVolumeOpenGL
-  vtkRenderingFreeType)
+  vtkRenderingFreeType Qt5::OpenGL)
diff --git a/tests/qtgui/CMakeLists.txt b/tests/qtgui/CMakeLists.txt
index 77d2697..15f00b5 100644
--- a/tests/qtgui/CMakeLists.txt
+++ b/tests/qtgui/CMakeLists.txt
@@ -50,9 +50,8 @@ endforeach()
 
 # Add a single executable for all of our tests.
 add_executable(AvogadroQtGuiTests ${testSrcs})
-qt5_use_modules(AvogadroQtGuiTests Widgets Test)
 target_link_libraries(AvogadroQtGuiTests AvogadroQtGui AvogadroMoleQueue
-  MoleQueueClient ${GTEST_BOTH_LIBRARIES} ${EXTRA_LINK_LIB})
+  MoleQueueClient ${GTEST_BOTH_LIBRARIES} ${EXTRA_LINK_LIB} Qt5::Widgets Qt5::Test)
 
 # Now add all of the tests, using the gtest_filter argument so that only those
 # cases are run in each test invocation.
diff --git a/tests/qtopengl/CMakeLists.txt b/tests/qtopengl/CMakeLists.txt
index 6490488..21c96a9 100644
--- a/tests/qtopengl/CMakeLists.txt
+++ b/tests/qtopengl/CMakeLists.txt
@@ -44,13 +44,12 @@ create_test_sourcelist(testDriver qtopengltests.cpp ${testSrcs})
 
 add_executable(AvogadroQtOpenGLTests ${testDriver})
 
-qt5_use_modules(AvogadroQtOpenGLTests OpenGL)
-
 target_link_libraries(AvogadroQtOpenGLTests
   AvogadroQtOpenGL
   vtkImagingCore
   vtkIOImage
-  vtkRenderingQt)
+  vtkRenderingQt
+  Qt5::OpenGL)
 
 foreach(test ${tests})
   string(TOLOWER ${test} testname)