diff -Naur liblastfm-1.0.9/CMakeLists.txt liblastfm-1.0.9-p/CMakeLists.txt
--- liblastfm-1.0.9/CMakeLists.txt	2014-10-02 16:05:46.000000000 +0200
+++ liblastfm-1.0.9-p/CMakeLists.txt	2018-06-14 13:37:53.632300793 +0200
@@ -20,6 +20,7 @@
 
 # installation dirs
 include(GNUInstallDirs)
+include(FeatureSummary)
 
 #cmake module path
 set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Modules")
@@ -27,20 +28,20 @@
 # setup qt stuff
 set(CMAKE_AUTOMOC ON)
 
-option(BUILD_WITH_QT4 "Build liblastfm with Qt4 no matter if Qt5 was found" OFF)
+option(BUILD_WITH_QT4 "Build liblastfm with Qt4" OFF)
 
-if( NOT BUILD_WITH_QT4 )
-    # try Qt5 first, and prefer that if found
-    find_package(Qt5Core QUIET)
-endif()
+if(NOT BUILD_WITH_QT4)
+    find_package(Qt5 REQUIRED COMPONENTS Core Network Xml CONFIG)
+
+    if(BUILD_FINGERPRINT)
+        find_package(Qt5Sql REQUIRED CONFIG)
+    endif()
 
-if(Qt5Core_DIR)
     set(LASTFM_LIB_VERSION_SUFFIX 5)
-    message(STATUS "Found Qt5! Please keep in mind, this is highly experimental and not our main development target..")
-    include_directories(${Qt5Core_INCLUDE_DIRS})
     if(UNIX AND NOT APPLE)
-        find_package(Qt5DBus REQUIRED)
+        find_package(Qt5DBus REQUIRED CONFIG)
     endif()
+    include_directories(Qt5::Core Qt5::Network Qt5::Xml)
 
 #     macro(qt_wrap_ui)
 #         qt5_wrap_ui(${ARGN})
@@ -56,9 +57,6 @@
 #     endmacro()
 else()
     find_package(Qt4 COMPONENTS QtCore QtNetwork QtXml REQUIRED)
-
-    macro(qt5_use_modules)
-    endmacro()
 endif()
 
 
@@ -97,3 +95,5 @@
     enable_testing()
     add_subdirectory(tests)
 endif()
+
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff -Naur liblastfm-1.0.9/src/CMakeLists.txt liblastfm-1.0.9-p/src/CMakeLists.txt
--- liblastfm-1.0.9/src/CMakeLists.txt	2014-10-02 16:05:46.000000000 +0200
+++ liblastfm-1.0.9-p/src/CMakeLists.txt	2018-06-14 13:37:53.632300793 +0200
@@ -3,16 +3,6 @@
 
 add_definitions(${QT_DEFINITIONS})
 include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
-set(liblastfm_LIBRARIES
-    ${QT_QTCORE_LIBRARY}
-    ${QT_QTNETWORK_LIBRARY}
-    ${QT_QTXML_LIBRARY}
-)
-
-list(APPEND liblastfm_QT5_MODULES
-    Xml
-    Network
-)
 
 set(liblastfm_SOURCES
         ws.cpp
@@ -49,15 +39,11 @@
     if(NOT MINGW)
         add_definitions("-D_ATL_DLL -D_CRT_SECURE_NO_WARNINGS")
 
-        list(APPEND liblastfm_SOURCES
+        set(liblastfm_SOURCES ${liblastfm_SOURCES}
             win/WNetworkConnectionMonitor_win.cpp
             win/WmiSink.cpp
             win/NdisEvents.cpp
         )
-        list(APPEND liblastfm_LIBRARIES
-            winhttp
-            wbemuuid
-        )
     endif()
 endif()
 
@@ -67,30 +53,51 @@
     #set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
     #set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}.sdk")
 
-    list(APPEND liblastfm_SOURCES
+    set(liblastfm_SOURCES ${liblastfm_SOURCES}
         mac/MNetworkConnectionMonitor_mac.cpp
     )
-
-    find_library(SYSTEMCONFIGURATION_LIBRARY SystemConfiguration)
-    find_library(COREFOUNDATION_LIBRARY CoreFoundation)
-    list(APPEND liblastfm_LIBRARIES
-        ${COREFOUNDATION_LIBRARY}
-        ${SYSTEMCONFIGURATION_LIBRARY}
-    )
 endif()
 
 if(UNIX AND NOT APPLE)
-    list(APPEND liblastfm_SOURCES
+    set(liblastfm_SOURCES ${liblastfm_SOURCES}
         linux/LNetworkConnectionMonitor_linux.cpp
     )
-    list(APPEND liblastfm_LIBRARIES ${QT_QTDBUS_LIBRARY})
-    list(APPEND liblastfm_QT5_MODULES DBus)
 endif()
 
 add_library(${LASTFM_LIB_TARGET_NAME} SHARED ${liblastfm_SOURCES})
-qt5_use_modules(${LASTFM_LIB_TARGET_NAME} ${liblastfm_QT5_MODULES})
 
-target_link_libraries(${LASTFM_LIB_TARGET_NAME} ${liblastfm_LIBRARIES})
+if(Qt5Core_DIR)
+    target_link_libraries(${LASTFM_LIB_TARGET_NAME} Qt5::Network Qt5::Xml)
+    if(UNIX AND NOT APPLE)
+        target_link_libraries(${LASTFM_LIB_TARGET_NAME} Qt5::DBus)
+    endif()
+else()
+    target_link_libraries(${LASTFM_LIB_TARGET_NAME}
+        ${QT_QTCORE_LIBRARY}
+        ${QT_QTNETWORK_LIBRARY}
+        ${QT_QTXML_LIBRARY}
+    )
+    if(UNIX AND NOT APPLE)
+        target_link_libraries(${LASTFM_LIB_TARGET_NAME} ${QT_QTDBUS_LIBRARY})
+    endif()
+endif()
+
+if(WIN32 AND NOT MINGW)
+    target_link_libraries(${LASTFM_LIB_TARGET_NAME}
+        winhttp
+        wbemuuid
+    )
+endif()
+
+if(APPLE)
+    find_library(SYSTEMCONFIGURATION_LIBRARY SystemConfiguration)
+    find_library(COREFOUNDATION_LIBRARY CoreFoundation)
+    target_link_libraries(${LASTFM_LIB_TARGET_NAME}
+        ${COREFOUNDATION_LIBRARY}
+        ${SYSTEMCONFIGURATION_LIBRARY}
+    )
+endif()
+
 set_target_properties(${LASTFM_LIB_TARGET_NAME} PROPERTIES
     VERSION ${LASTFM_VERSION_STRING}
     SOVERSION ${LASTFM_SOVERSION}
diff -Naur liblastfm-1.0.9/src/fingerprint/CMakeLists.txt liblastfm-1.0.9-p/src/fingerprint/CMakeLists.txt
--- liblastfm-1.0.9/src/fingerprint/CMakeLists.txt	2014-10-02 16:05:46.000000000 +0200
+++ liblastfm-1.0.9-p/src/fingerprint/CMakeLists.txt	2018-06-14 13:37:53.632300793 +0200
@@ -26,21 +26,23 @@
 
 add_library(${FINGERPRINT_LIB_TARGET_NAME} SHARED ${lastfm_fingerprint_SOURCES})
 
-target_link_libraries(${FINGERPRINT_LIB_TARGET_NAME}
-    ${LASTFM_LIB_TARGET_NAME}
-    ${QT_QTSQL_LIBRARY}
-    ${QT_QTCORE_LIBRARY}
-    ${LIBSAMPLERATE_LIBRARY}
-    ${LIBFFTW3_LIBRARY}
-)
-
 set_target_properties(${FINGERPRINT_LIB_TARGET_NAME} PROPERTIES
     COMPILE_DEFINITIONS LASTFM_FINGERPRINT_LIB
     VERSION ${LASTFM_VERSION_STRING}
     SOVERSION ${LASTFM_SOVERSION}
 )
 
-qt5_use_modules(${FINGERPRINT_LIB_TARGET_NAME} Network Sql Xml)
+target_link_libraries(${FINGERPRINT_LIB_TARGET_NAME}
+    ${LASTFM_LIB_TARGET_NAME}
+    ${LIBSAMPLERATE_LIBRARY}
+    ${LIBFFTW3_LIBRARY}
+)
+
+if(Qt5Core_DIR)
+    target_link_libraries(${FINGERPRINT_LIB_TARGET_NAME} Qt5::Network Qt5::Sql Qt5::Xml)
+else()
+    target_link_libraries(${FINGERPRINT_LIB_TARGET_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTSQL_LIBRARY})
+endif()
 
 install(TARGETS ${FINGERPRINT_LIB_TARGET_NAME}
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
diff -Naur liblastfm-1.0.9/tests/lastfm_add_test.cmake liblastfm-1.0.9-p/tests/lastfm_add_test.cmake
--- liblastfm-1.0.9/tests/lastfm_add_test.cmake	2014-10-02 16:05:46.000000000 +0200
+++ liblastfm-1.0.9-p/tests/lastfm_add_test.cmake	2018-06-14 13:37:53.632300793 +0200
@@ -6,13 +6,15 @@
     configure_file(Test${LASTFM_TEST_CLASS}.h Test${LASTFM_TEST_CLASS}.h)
     add_executable(${LASTFM_TEST_CLASS}Test Test${LASTFM_TEST_CLASS}.cpp)
 
-    qt5_use_modules(${LASTFM_TEST_CLASS}Test Core Test Xml Network)
-
-    target_link_libraries(${LASTFM_TEST_CLASS}Test
-        ${LASTFM_LIB_TARGET_NAME}
-        ${QT_QTTEST_LIBRARY}
-        ${QT_QTCORE_LIBRARY}
-    )
+    if(Qt5Core_DIR)
+        target_link_libraries(${LASTFM_TEST_CLASS}Test Qt5::Core Qt5::Test Qt5::Xml Qt5::Network
+            ${LASTFM_LIB_TARGET_NAME}
+        )
+    else()
+        target_link_libraries(${LASTFM_TEST_CLASS}Test ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY}
+            ${LASTFM_LIB_TARGET_NAME}
+        )
+    endif()
 
     add_test(NAME ${LASTFM_TEST_CLASS}Test COMMAND ${LASTFM_TEST_CLASS}Test)
 endmacro()
