diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2018-11-12 16:38:34 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2018-11-13 22:55:26 +0200 |
commit | cd92a231b3e11c65321a48d0167898bb0e5a5fa8 (patch) | |
tree | f821513781bee5b9039945489d1fe926c8900a6d /platform/qt/qt.cmake | |
parent | b891a8d6b0dc9e92a283756448b4671bef3da71f (diff) | |
download | qtlocation-mapboxgl-cd92a231b3e11c65321a48d0167898bb0e5a5fa8.tar.gz |
[qt] Deprecate Qt4 and old versions of Qt5
Not enough adoption to keep the platform alive.
Diffstat (limited to 'platform/qt/qt.cmake')
-rw-r--r-- | platform/qt/qt.cmake | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake index e12e20708f..2e334563ed 100644 --- a/platform/qt/qt.cmake +++ b/platform/qt/qt.cmake @@ -3,7 +3,6 @@ option(WITH_QT_DECODERS "Use builtin Qt image decoders" OFF) option(WITH_QT_I18N "Use builtin Qt i18n support" OFF) -option(WITH_QT_4 "Use Qt4 instead of Qt5" OFF) add_definitions("-D__QT__") @@ -112,11 +111,32 @@ target_link_libraries(mbgl-qt PRIVATE qmapboxgl ) -if(WITH_QT_4) - include(platform/qt/qt4.cmake) -else() - include(platform/qt/qt5.cmake) -endif() +find_package(Qt5Core REQUIRED) +find_package(Qt5Gui REQUIRED) +find_package(Qt5Network REQUIRED) +find_package(Qt5OpenGL REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Sql REQUIRED) + +# Qt5 always build OpenGL ES2 which is the compatibility +# mode. Qt5 will take care of translating the desktop +# version of OpenGL to ES2. +add_definitions("-DMBGL_USE_GLES2") + +set(MBGL_QT_CORE_LIBRARIES + PUBLIC Qt5::Core + PUBLIC Qt5::Gui + PUBLIC Qt5::OpenGL +) + +set(MBGL_QT_FILESOURCE_LIBRARIES + PUBLIC Qt5::Network + PUBLIC Qt5::Sql +) + +target_link_libraries(mbgl-qt + PRIVATE Qt5::Widgets +) xcode_create_scheme(TARGET mbgl-qt) @@ -128,20 +148,10 @@ if (MASON_PLATFORM STREQUAL "osx" OR MASON_PLATFORM STREQUAL "ios") list(APPEND MBGL_QT_CORE_LIBRARIES PRIVATE "-framework Foundation" ) - if(WITH_QT_4) - list(APPEND MBGL_QT_CORE_LIBRARIES - PRIVATE "-framework OpenGL" - ) - endif() elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") list(APPEND MBGL_QT_CORE_FILES PRIVATE platform/default/thread.cpp ) - if(WITH_QT_4) - list(APPEND MBGL_QT_CORE_LIBRARIES - PRIVATE "-lGL" - ) - endif() elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") add_definitions("-DQT_COMPILING_QIMAGE_COMPAT_CPP") add_definitions("-DRAPIDJSON_HAS_CXX11_RVALUE_REFS") |