Commit 2ac4cf6f authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Fix setting the min Qt version + set also for non-Android builds to 5.3.0

* QT_REQUIRED_VERSION is not read by anything,
  find_package needs explicit parameter
* REQUIRED_QT_VERSION as name seems more standard
parent 0779aa8a
......@@ -65,44 +65,54 @@ else()
option(BUILD_WITH_DBUS "Build the D-Bus interface for the Marble widget" ON)
endif()
#######################################################
# Specific options for building for different platforms
if(CMAKE_SYSTEM_NAME STREQUAL Android)
add_definitions(-DANDROID)
endif()
#######################################################
# Find Qt dependencies
# Minimum Qt version
set(QT_REQUIRED_VERSION 5.3.0)
# Minimum Qt version
set(REQUIRED_QT_VERSION 5.3.0)
if(CMAKE_SYSTEM_NAME STREQUAL Android)
# TODO: still needed with ECM toolchain?
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(Qt5Script ${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(Qt5Location REQUIRED)
find_package(Qt5Positioning REQUIRED)
find_package(Qt5Multimedia REQUIRED)
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)
set ( MARBLE_NO_WEBKITWIDGETS TRUE )
else()
find_package(Qt5WebKit)
find_package(Qt5WebKitWidgets)
find_package(Qt5WebKit ${REQUIRED_QT_VERSION})
find_package(Qt5WebKitWidgets ${REQUIRED_QT_VERSION})
if ( NOT Qt5WebKitWidgets_FOUND )
set ( MARBLE_NO_WEBKITWIDGETS TRUE )
endif()
endif()
find_package(Qt5Core REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Test REQUIRED)
find_package(Qt5Script REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Svg REQUIRED)
find_package(Qt5Sql REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
if (BUILD_WITH_DBUS)
find_package(Qt5DBus)
find_package(Qt5DBus ${REQUIRED_QT_VERSION})
if (NOT Qt5DBus_FOUND)
set(MARBLE_NO_DBUS TRUE)
endif()
......
......@@ -6,7 +6,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_SYSTEM_NAME STREQUAL Android)
set(TARGET MarbleBehaim)
find_package(Qt5AndroidExtras)
find_package(Qt5AndroidExtras ${REQUIRED_QT_VERSION})
add_library (${TARGET} SHARED ${marble_SRCS} ${marble_QRCS})
......
PROJECT( MarbleDeclarativePlugin )
macro_optional_find_package(Qt5Positioning)
macro_optional_find_package(Qt5Positioning ${REQUIRED_QT_VERSION})
if(Qt5Positioning_FOUND)
add_definitions(-DHAVE_QT5_POSITIONING)
endif(Qt5Positioning_FOUND)
......
if (WITH_DESIGNER_PLUGIN)
# TODO: find why this is not listed in the feature_summary (same with Qt5UiPlugin)
find_package(Qt5Designer QUIET)
find_package(Qt5Designer ${REQUIRED_QT_VERSION} QUIET)
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)
......
......@@ -8,8 +8,8 @@ IF(LIBGPS_FOUND)
ADD_SUBDIRECTORY( gpsd )
ENDIF(LIBGPS_FOUND)
macro_optional_find_package(Qt5Location)
macro_optional_find_package(Qt5Positioning)
macro_optional_find_package(Qt5Location ${REQUIRED_QT_VERSION})
macro_optional_find_package(Qt5Positioning ${REQUIRED_QT_VERSION})
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" )
......
PROJECT(AprsPlugin)
macro_optional_find_package(Qt5SerialPort)
macro_optional_find_package(Qt5SerialPort ${REQUIRED_QT_VERSION})
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" )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment