summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorStefan Wildemann <metalstrolch@users.noreply.github.com>2017-04-05 20:06:28 +0200
committerPierre GRANDIN <pgrandin@users.noreply.github.com>2017-04-05 11:06:28 -0700
commitf466ed624c282e30869fa1cc04f191812e0b4888 (patch)
tree0537f6a34b41b767507da5ef3161bcaba8064ada /CMakeLists.txt
parent480200b03e4f887ef82a62a950dad19dd609ec9c (diff)
downloadnavit-f466ed624c282e30869fa1cc04f191812e0b4888.tar.gz
Qt5 Graphics: Add QML support (#213)R7378
* Qt5: Add navit callbacks to private Add navit callbacks to private data, to prepare qt5 graphics transition to QML 2.0 instead of QWidget. * Qt5: use only one widget Refactor qt5 code to use only one widget. Overlays won't have their own widgets anymore. This is in peparation for converting qt4 graphics to QML 2.0 * initial addition of QML to qt5 graphics. * Add first (bogus) qml file. This commit adds the qml file for the qt5 qml graphics if used with internal gui. And it alters the cmake scripts to istall it. * Add inital Quick component Now this has it's own c++ Quick component included. Additionally the qml file gets embedded into the plugin. * Small cleanup, qml package name correction. * Convert to QGuiApplication to remove QWidget dep. * First time working QQuick Navit * Lower qml import versions, as sailfish uses old ones. * Add header to QtQuick item. * Add new attr qt5_widget to qt5 * Add qt5 variants to test * Correct mistake in running test for qt5 * Fix: Tomtom libpng version bump to 1.6.29 The libpng version 1.6.28 was removed from ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/ * Fix: Make window as big as possible if w and h are not given * Fix navit config for run_linux_test, complete test separation. * Fix xdotools use separatelog dir * Fix: correct mess generated with last commit * Convert from CMAKE_AUTORRC to old macros We want to support old cmake, that doesn't have AUTORRC * Fix: Add qml modules to build in order to allow QML graphics to run * Fix: Use trusty packages instead.
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-xCMakeLists.txt41
1 files changed, 30 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 819e7d450..fe9457e23 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -158,18 +158,24 @@ libfind_pkg_check_modules(FONTCONFIG fontconfig)
#Qt detection
if (NOT DISABLE_QT)
find_package(Qt5Widgets)
- find_package(Qt5Svg)
- find_package(Qt5DBus)
+ find_package(Qt5Quick)
find_package(Qt5Positioning)
- find_package(Qt5Sensors)
- #find_package(Qt5Declarative)
- if (Qt5Widgets_FOUND)
- else (Qt5Widgets_FOUND)
+ if (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND)
+ add_feature (USE_QWIDGET "Qt5 Qt5Widget not found" FALSE)
+ add_feature (USE_QML "Qt5 Qt5Quick not found" FALSE)
+ if (Qt5Widgets_FOUND OR Qt5Quick_FOUND)
+ find_package(Qt5Svg REQUIRED)
+ find_package(Qt5DBus REQUIRED)
+ endif (Qt5Widgets_FOUND OR Qt5Quick_FOUND)
+ if (Qt5Positioning_FOUND)
+ find_package(Qt5Sensors REQUIRED)
+ endif (Qt5Positioning_FOUND)
+ else (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND)
# Unfortunately, CMake seems to ignore the "OPTIONAL_COMPONENTS" flag,
# and actually requires all components to be installed. Maybe this can
# be fixed later...
find_package(Qt4 4.7 COMPONENTS QtCore OPTIONAL_COMPONENTS QtGui QtXml QtDeclarative QtSvg)
- endif (Qt5Widgets_FOUND)
+ endif (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND)
endif (NOT DISABLE_QT)
#pkg-config based detection
@@ -313,14 +319,27 @@ if (QT_FOUND)
endif()
endif()
endif(QT_FOUND)
-if (Qt5Widgets_FOUND)
- set_with_reason(graphics/qt5 "Qt5 found" TRUE ${Qt5Widgets_LIBRARIES}
- ${Qt5Declarative_LIBRARIES}
+if (Qt5Widgets_FOUND OR Qt5Quick_FOUND)
+ set(Qt5_ADDITIONAL_LIBRARIES "")
+ if(Qt5Widgets_FOUND)
+ set_with_reason(USE_QWIDGET "Qt5Widgets found" TRUE)
+ if(USE_QWIDGET)
+ set(Qt5_ADDITIONAL_LIBRARIES ${Qt5_ADDITIONAL_LIBRARIES} ${Qt5Widgets_LIBRARIES})
+ endif()
+ endif()
+ if(Qt5Quick_FOUND)
+ set_with_reason(USE_QML "Qt5Quick found" TRUE)
+ if(USE_QML)
+ set(Qt5_ADDITIONAL_LIBRARIES ${Qt5_ADDITIONAL_LIBRARIES} ${Qt5Quick_LIBRARIES})
+ endif()
+ endif()
+ set_with_reason(graphics/qt5 "Qt5 found" TRUE
+ ${Qt5_ADDITIONAL_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5DBus_LIBRARIES})
endif ()
if (Qt5Positioning_FOUND)
- set_with_reason(vehicle/qt5 "Qt5 Positioning found" TRUE
+ set_with_reason(vehicle/qt5 "Qt5 Positioning found" TRUE
${Qt5Positioning_LIBRARIES}
${Qt5Sensors_LIBRARIES})
endif ()