summaryrefslogtreecommitdiff
path: root/platform/qt/config.cmake
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-07-18 14:44:41 +0300
committerKonstantin Käfer <mail@kkaefer.com>2016-08-05 11:42:22 +0200
commit821e58fdc1a21598e26dda542476ea530ac3c275 (patch)
tree9b969864e8f6eb598f133abd2bbb2fe1674f49e8 /platform/qt/config.cmake
parent4e5fc0d7a4cbb85e9e43f5cac958ef132512c413 (diff)
downloadqtlocation-mapboxgl-821e58fdc1a21598e26dda542476ea530ac3c275.tar.gz
[build] Build Qt with CMake
Diffstat (limited to 'platform/qt/config.cmake')
-rw-r--r--platform/qt/config.cmake62
1 files changed, 62 insertions, 0 deletions
diff --git a/platform/qt/config.cmake b/platform/qt/config.cmake
new file mode 100644
index 0000000000..41abe30174
--- /dev/null
+++ b/platform/qt/config.cmake
@@ -0,0 +1,62 @@
+include(platform/qt/qt.cmake)
+
+mason_use(nunicode 1.6)
+mason_use(sqlite 3.9.1)
+
+if(NOT WITH_QT_DECODERS)
+ mason_use(libjpeg-turbo 1.4.2)
+ mason_use(libpng 1.6.20)
+ mason_use(webp 0.5.0)
+endif()
+
+macro(mbgl_platform_core)
+ target_sources(mbgl-core
+ ${MBGL_QT_FILES}
+ )
+
+ target_include_directories(mbgl-core
+ PRIVATE platform/default
+ PRIVATE platform/qt/include
+ )
+
+ target_add_mason_package(mbgl-core PRIVATE nunicode)
+ target_add_mason_package(mbgl-core PRIVATE sqlite)
+
+ target_link_libraries(mbgl-core
+ ${MBGL_QT_LIBRARIES}
+ )
+
+ if(NOT WITH_QT_DECODERS)
+ target_sources(mbgl-core
+ PRIVATE platform/default/jpeg_reader.cpp
+ PRIVATE platform/default/png_reader.cpp
+ PRIVATE platform/default/webp_reader.cpp
+ )
+
+ target_add_mason_package(mbgl-core PRIVATE libjpeg-turbo)
+ target_add_mason_package(mbgl-core PRIVATE libpng)
+ target_add_mason_package(mbgl-core PRIVATE webp)
+ else()
+ add_definitions(-DQT_IMAGE_DECODERS)
+ endif()
+endmacro()
+
+# TODO: Implement a Qt headless view, using offscreen
+# graphics system. Right now tests are Linux only.
+macro(mbgl_platform_test)
+ target_sources(mbgl-test
+ PRIVATE platform/default/headless_display.cpp
+ PRIVATE platform/default/headless_view.cpp
+ PRIVATE platform/default/headless_view_glx.cpp
+ PRIVATE test/src/main.cpp
+ )
+
+ set_source_files_properties(
+ test/src/main.cpp
+ PROPERTIES COMPILE_FLAGS -DWORK_DIRECTORY="${CMAKE_SOURCE_DIR}"
+ )
+
+ target_link_libraries(mbgl-test
+ PRIVATE -lX11
+ )
+endmacro()