QTfrontend/CMakeLists.txt
branchqt5transition
changeset 12901 8869b5256720
parent 12391 e4f8bf43224d
child 12902 fc47fc4af6bd
--- a/QTfrontend/CMakeLists.txt	Mon Jan 15 12:15:56 2018 -0500
+++ b/QTfrontend/CMakeLists.txt	Wed Jan 24 21:05:34 2018 +0100
@@ -1,24 +1,6 @@
-# Configure for Qt4
-set(QT_MIN_VERSION "4.7.0")
-include(CheckLibraryExists)
+find_package(Qt5 COMPONENTS Core Gui Network Svg Xml OpenGL)
 
-set(QT_USE_QTCORE TRUE)
-set(QT_USE_QTGUI TRUE)
-set(QT_USE_QTNETWORK TRUE)
-set(QT_USE_QTSVG FALSE)
-set(QT_USE_QTXML FALSE)
-set(QT_USE_QTOPENGL FALSE)
-set(QT_USE_QTMAIN TRUE)
-
-find_package(Qt4 REQUIRED)
-include(${QT_USE_FILE})
-
-# https://bugreports.qt-project.org/browse/QTBUG-17333
-if(APPLE AND
-   ${QTVERSION} VERSION_GREATER "4.7.0" AND
-   ${QTVERSION} VERSION_LESS "4.7.4")
-   message(FATAL_ERROR "This version of Qt is known *not* to work, please update or use a lower version")
-endif()
+include(CheckLibraryExists)
 
 find_package(SDL2 REQUIRED)
 find_package(SDL2_mixer 2 REQUIRED) #audio in SDLInteraction
@@ -159,9 +141,9 @@
     endif()
 endif()
 
-qt4_add_resources(hwfr_rez_src ${hwfr_rez})
+qt5_add_resources(hwfr_rez_src ${hwfr_rez})
 
-qt4_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
+qt5_wrap_cpp(hwfr_moc_srcs ${hwfr_moc_hdrs})
 
 
 if(APPLE)
@@ -198,14 +180,14 @@
 
 list(APPEND HW_LINK_LIBS
     physfs physlayer
-    ${QT_LIBRARIES}
+    Qt5::Core Qt5::Gui Qt5::Network Qt5::Svg Qt5::Xml Qt5::OpenGL
     )
 
 list(APPEND HW_LINK_LIBS
     ${SDL2_LIBRARY}
     ${SDL2_MIXER_LIBRARIES}
     )
-    
+
 if(WIN32 AND NOT UNIX)
     if(NOT SDL2_LIBRARY)
         list(APPEND HW_LINK_LIBS SDL2)