maplibre support for Qt6 and MSVC 2019 (#125)
* [qt] Updating CMake project files for Qt6 * [qt] Updating non-test projects for Qt6 and msvc2019 * [qt] Test fixes for Qt6 and msvc2019 * [qt] Link whole test archive for Qt and msvc2019 * [qt] Fixing Qt6 headless backend renderer * [qt] Fixes for test failures * [qt] Expression and style parser test fixes * [qt] Backwards compatibility with Qt5 and Qt6 Minimum version is Qt 5.4 due to use of QOpenGLWidget * [qt] LLVM is no longer required for a Windows build * [msvc] msvc2019 fixes for maplibre * Update test/storage/offline_database.test.cpp Co-authored-by: Tadej Novak <tadej@tano.si> * Vector + const is not standard C++ Co-authored-by: Tadej Novak <tadej@tano.si>
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
# Note: Using Sqlite instead of QSqlDatabase for better compatibility.
|
||||
|
||||
find_package(Qt5Gui REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
find_package(Qt5OpenGL REQUIRED)
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR}
|
||||
COMPONENTS Gui
|
||||
Network
|
||||
OpenGL
|
||||
OpenGLWidgets
|
||||
Widgets
|
||||
REQUIRED)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
if(MSVC)
|
||||
add_definitions("/DQT_COMPILING_QIMAGE_COMPAT_CPP")
|
||||
add_definitions("/D_USE_MATH_DEFINES")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
add_definitions("-DQT_COMPILING_QIMAGE_COMPAT_CPP")
|
||||
add_definitions("-D_USE_MATH_DEFINES")
|
||||
add_definitions("-Wno-deprecated-declarations")
|
||||
@@ -89,10 +95,10 @@ target_link_libraries(
|
||||
PRIVATE
|
||||
$<$<NOT:$<PLATFORM_ID:Windows>>:z>
|
||||
$<$<NOT:$<PLATFORM_ID:Windows>>:mbgl-vendor-icu>
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
Qt5::OpenGL
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::OpenGL
|
||||
mbgl-vendor-nunicode
|
||||
mbgl-vendor-sqlite
|
||||
)
|
||||
@@ -136,8 +142,8 @@ target_compile_definitions(
|
||||
target_link_libraries(
|
||||
qmapboxgl
|
||||
PRIVATE
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
mbgl-compiler-options
|
||||
mbgl-core
|
||||
)
|
||||
@@ -156,8 +162,9 @@ set_property(TARGET mbgl-qt PROPERTY CXX_STANDARD 98)
|
||||
target_link_libraries(
|
||||
mbgl-qt
|
||||
PRIVATE
|
||||
Qt5::Widgets
|
||||
Qt5::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::OpenGLWidgets
|
||||
mbgl-compiler-options
|
||||
qmapboxgl
|
||||
)
|
||||
@@ -177,20 +184,41 @@ target_compile_definitions(
|
||||
PRIVATE WORK_DIRECTORY=${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
mbgl-test-runner
|
||||
PRIVATE
|
||||
Qt5::Gui
|
||||
Qt5::OpenGL
|
||||
mbgl-compiler-options
|
||||
pthread
|
||||
)
|
||||
if (MSVC)
|
||||
target_link_libraries(
|
||||
mbgl-test-runner
|
||||
PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::OpenGL
|
||||
mbgl-compiler-options
|
||||
)
|
||||
else()
|
||||
target_link_libraries(
|
||||
mbgl-test-runner
|
||||
PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::OpenGL
|
||||
mbgl-compiler-options
|
||||
pthread
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
target_link_libraries(
|
||||
mbgl-test-runner
|
||||
PRIVATE -Wl,-force_load mbgl-test
|
||||
)
|
||||
elseif(MSVC)
|
||||
target_link_options(
|
||||
mbgl-test-runner
|
||||
PRIVATE /WHOLEARCHIVE:../../lib/mbgl-test.lib
|
||||
)
|
||||
target_link_libraries(
|
||||
mbgl-test-runner
|
||||
PRIVATE mbgl-test
|
||||
)
|
||||
else()
|
||||
target_link_libraries(
|
||||
mbgl-test-runner
|
||||
|
||||
Reference in New Issue
Block a user