summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2016-11-06 21:27:14 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-11-06 21:37:26 (GMT)
commitd059a6e31083568b464f5b0f80eede1e03e082a3 (patch)
tree2a5d9691698ce755721f910447ee7b43ad1e4ff7
parent3fd4c294e67694d7a522a46305920325ad0de6d8 (diff)
Use COMPONENTS when searching for Qt5 modules
This allows to control the location of the Qt installation with a single -DQt5_DIR=... instead of having to pass this for every Qt module.
-rw-r--r--CMakeLists.txt41
-rw-r--r--src/apps/behaim/CMakeLists.txt2
-rw-r--r--src/apps/marble-maps/CMakeLists.txt7
-rw-r--r--src/lib/marble/declarative/CMakeLists.txt2
-rw-r--r--src/plugins/designer/CMakeLists.txt4
-rw-r--r--src/plugins/positionprovider/CMakeLists.txt7
-rw-r--r--src/plugins/render/aprs/CMakeLists.txt2
7 files changed, 40 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 99a095f..04537ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,25 +85,34 @@ if(CMAKE_SYSTEM_NAME STREQUAL Android)
SET(QT_QMAKE_EXECUTABLE "$ENV{Qt5_android}/bin/qmake")
endif()
-find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5Xml ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5Network ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5Test ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5Widgets ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5Svg ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5Sql ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5Concurrent ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5Quick ${REQUIRED_QT_VERSION} REQUIRED)
-find_package(Qt5PrintSupport ${REQUIRED_QT_VERSION} REQUIRED)
+find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED
+ COMPONENTS
+ Core
+ Xml
+ Network
+ Test
+ Widgets
+ Svg
+ Sql
+ Concurrent
+ Quick
+ PrintSupport
+)
if(CMAKE_SYSTEM_NAME STREQUAL Android)
- find_package(Qt5Location ${REQUIRED_QT_VERSION} REQUIRED)
- find_package(Qt5Positioning ${REQUIRED_QT_VERSION} REQUIRED)
- find_package(Qt5Multimedia ${REQUIRED_QT_VERSION} REQUIRED)
+ find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED
+ COMPONENTS
+ Location
+ Positioning
+ Multimedia
+ )
set ( MARBLE_NO_WEBKITWIDGETS TRUE )
else()
- find_package(Qt5WebKit ${REQUIRED_QT_VERSION})
- find_package(Qt5WebKitWidgets ${REQUIRED_QT_VERSION})
+ find_package(Qt5 ${REQUIRED_QT_VERSION}
+ COMPONENTS
+ WebKit
+ WebKitWidgets
+ )
if ( NOT Qt5WebKitWidgets_FOUND )
set ( MARBLE_NO_WEBKITWIDGETS TRUE )
@@ -111,7 +120,7 @@ else()
endif()
if (BUILD_WITH_DBUS)
- find_package(Qt5DBus ${REQUIRED_QT_VERSION})
+ find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS DBus)
if (NOT Qt5DBus_FOUND)
set(MARBLE_NO_DBUS TRUE)
endif()
diff --git a/src/apps/behaim/CMakeLists.txt b/src/apps/behaim/CMakeLists.txt
index 5991e40..02a6e40 100644
--- a/src/apps/behaim/CMakeLists.txt
+++ b/src/apps/behaim/CMakeLists.txt
@@ -6,7 +6,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_SYSTEM_NAME STREQUAL Android)
set(TARGET MarbleBehaim)
- find_package(Qt5AndroidExtras ${REQUIRED_QT_VERSION})
+ find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS AndroidExtras)
add_library (${TARGET} SHARED ${marble_SRCS} ${marble_QRCS})
diff --git a/src/apps/marble-maps/CMakeLists.txt b/src/apps/marble-maps/CMakeLists.txt
index 2111aa0..ad48474 100644
--- a/src/apps/marble-maps/CMakeLists.txt
+++ b/src/apps/marble-maps/CMakeLists.txt
@@ -6,8 +6,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_SYSTEM_NAME STREQUAL Android)
set(TARGET Marble)
- find_package(Qt5AndroidExtras)
- find_package(Qt5QuickControls2)
+ find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED
+ COMPONENTS
+ AndroidExtras
+ QuickControls2
+ )
add_library (${TARGET} SHARED ${marble_SRCS} ${marble_QRCS})
diff --git a/src/lib/marble/declarative/CMakeLists.txt b/src/lib/marble/declarative/CMakeLists.txt
index 86660e4..324ca59 100644
--- a/src/lib/marble/declarative/CMakeLists.txt
+++ b/src/lib/marble/declarative/CMakeLists.txt
@@ -1,6 +1,6 @@
PROJECT( MarbleDeclarativePlugin )
-macro_optional_find_package(Qt5Positioning ${REQUIRED_QT_VERSION})
+find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS Positioning)
if(Qt5Positioning_FOUND)
add_definitions(-DHAVE_QT5_POSITIONING)
endif(Qt5Positioning_FOUND)
diff --git a/src/plugins/designer/CMakeLists.txt b/src/plugins/designer/CMakeLists.txt
index b421e5b..78d69df 100644
--- a/src/plugins/designer/CMakeLists.txt
+++ b/src/plugins/designer/CMakeLists.txt
@@ -1,11 +1,11 @@
if (WITH_DESIGNER_PLUGIN)
# TODO: find why this is not listed in the feature_summary (same with Qt5UiPlugin)
- find_package(Qt5Designer ${REQUIRED_QT_VERSION} QUIET)
+ find_package(Qt5 ${REQUIRED_QT_VERSION} QUIET COMPONENTS Designer)
marble_set_package_properties( Qt5Designer PROPERTIES TYPE OPTIONAL PURPOSE "Required to build Qt Designer plugins" )
if(NOT Qt5Designer_VERSION_STRING VERSION_LESS 5.5.0)
- find_package(Qt5UiPlugin ${REQUIRED_QT_VERSION} CONFIG QUIET)
+ find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG QUIET COMPONENTS UiPlugin)
set_package_properties(Qt5UiPlugin PROPERTIES TYPE OPTIONAL
PURPOSE "Required to build Qt Designer plugins"
)
diff --git a/src/plugins/positionprovider/CMakeLists.txt b/src/plugins/positionprovider/CMakeLists.txt
index 26e4fe3..91f13e2 100644
--- a/src/plugins/positionprovider/CMakeLists.txt
+++ b/src/plugins/positionprovider/CMakeLists.txt
@@ -8,8 +8,11 @@ IF(LIBGPS_FOUND)
ADD_SUBDIRECTORY( gpsd )
ENDIF(LIBGPS_FOUND)
-macro_optional_find_package(Qt5Location ${REQUIRED_QT_VERSION})
-macro_optional_find_package(Qt5Positioning ${REQUIRED_QT_VERSION})
+find_package(Qt5 ${REQUIRED_QT_VERSION}
+ COMPONENTS
+ Location
+ Positioning
+)
marble_set_package_properties( Qt5Positioning PROPERTIES DESCRIPTION "a collection of APIs and frameworks" )
marble_set_package_properties( Qt5Positioning PROPERTIES URL "http://qt.digia.com/" )
marble_set_package_properties( Qt5Positioning PROPERTIES TYPE OPTIONAL PURPOSE "Required for QtLocation to work" )
diff --git a/src/plugins/render/aprs/CMakeLists.txt b/src/plugins/render/aprs/CMakeLists.txt
index ec932e7..f1dc8f6 100644
--- a/src/plugins/render/aprs/CMakeLists.txt
+++ b/src/plugins/render/aprs/CMakeLists.txt
@@ -1,6 +1,6 @@
PROJECT(AprsPlugin)
-macro_optional_find_package(Qt5SerialPort ${REQUIRED_QT_VERSION})
+find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS SerialPort)
marble_set_package_properties( Qt5SerialPort PROPERTIES DESCRIPTION "Provides access to hardware and virtual serial ports." )
marble_set_package_properties( Qt5SerialPort PROPERTIES TYPE OPTIONAL PURPOSE "Reading from serial port in APRS plugin" )