Skip to content
Permalink
Browse files

[cmake] find Qt5 the right way

  • Loading branch information
3nids authored and nyalldawson committed Jun 25, 2020
1 parent 5936249 commit 8aecfdd93afcd15b904457d00d87ec04f8fe74af
Showing with 10 additions and 24 deletions.
  1. +8 −22 CMakeLists.txt
  2. +2 −2 src/gui/CMakeLists.txt
@@ -384,41 +384,28 @@ IF(WITH_CORE)
# Use Qt5SerialPort optionally for GPS
SET (WITH_QT5SERIALPORT TRUE CACHE BOOL "Determines whether Qt5SerialPort should be tried for GPS positioning")
IF (WITH_QT5SERIALPORT)
FIND_PACKAGE(Qt5SerialPort REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS SerialPort REQUIRED)
# following variable is used in qgsconfig.h
SET (HAVE_QT5SERIALPORT TRUE)
ENDIF(WITH_QT5SERIALPORT)

FIND_PACKAGE(Qt5Core QUIET)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(Qt5Network REQUIRED)
FIND_PACKAGE(Qt5Xml REQUIRED)
FIND_PACKAGE(Qt5Svg REQUIRED)
FIND_PACKAGE(Qt5Concurrent REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS Core Gui Widgets Network Xml Svg Concurrent Test UiTools Sql REQUIRED)
IF (NOT IOS)
FIND_PACKAGE(Qt5PrintSupport REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS PrintSupport REQUIRED)
ELSE(NOT IOS)
ADD_DEFINITIONS(-DQT_NO_PRINTER)
ENDIF(NOT IOS)
FIND_PACKAGE(Qt5Positioning)
FIND_PACKAGE(Qt5 COMPONENTS Positioning)
IF (WITH_QTWEBKIT)
FIND_PACKAGE(Qt5WebKit REQUIRED)
FIND_PACKAGE(Qt5WebKitWidgets REQUIRED)
ENDIF(WITH_QTWEBKIT)
FIND_PACKAGE(Qt5Test REQUIRED)
FIND_PACKAGE(Qt5UiTools REQUIRED)
FIND_PACKAGE(Qt5Sql REQUIRED)
IF (WITH_3D)
FIND_PACKAGE(Qt53DCore REQUIRED)
FIND_PACKAGE(Qt53DRender REQUIRED)
FIND_PACKAGE(Qt53DInput REQUIRED)
FIND_PACKAGE(Qt53DLogic REQUIRED)
FIND_PACKAGE(Qt53DExtras REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS 3DCore 3DRender 3DInput 3DLogic 3DExtras REQUIRED)
SET(HAVE_3D TRUE) # used in qgsconfig.h
ENDIF (WITH_3D)
IF (APPLE)
FIND_PACKAGE(Qt5MacExtras REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS MacExtras REQUIRED)
ENDIF (APPLE)

# get the Qt plugins directory
@@ -427,10 +414,9 @@ IF(WITH_CORE)

MESSAGE(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}")
IF (WITH_QUICK)
FIND_PACKAGE(Qt5Qml REQUIRED)
FIND_PACKAGE(Qt5Quick REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS Qml Quick REQUIRED)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Android")
FIND_PACKAGE(Qt5AndroidExtras)
FIND_PACKAGE(Qt5 COMPONENTS AndroidExtras)
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Android")
FIND_PACKAGE(QtQmlTools)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Android")
@@ -1138,8 +1138,8 @@ SET(QGIS_GUI_PRIVATE_HDRS
attributetable/qgsfeaturefilterwidget_p.h
)

FIND_PACKAGE(Qt5Qml REQUIRED)
FIND_PACKAGE(Qt5QuickWidgets REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS Qml REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS QuickWidgets REQUIRED)

IF(Qt5Qml_FOUND)
ADD_DEFINITIONS(-DWITH_QML)

0 comments on commit 8aecfdd

Please sign in to comment.
You can’t perform that action at this time.