1
0
Fork 0

Translations: detect missing lrelease explicitly.

This gives a clearer message and behaviour when Qt is installed but
the translation tools have been omitted.
This commit is contained in:
James Turner 2018-09-01 14:59:24 +01:00
parent e6a3b9c012
commit c537bbcfe7
2 changed files with 8 additions and 2 deletions

View file

@ -326,14 +326,13 @@ endif (USE_DBUS)
## Qt5 setup setup
if (ENABLE_QT)
message(STATUS "Qt launcher enabled, checking for Qt >= 5.4 / qmake")
find_package(Qt5 5.4 COMPONENTS Widgets Network Qml Quick Svg LinguistTools)
find_package(Qt5 5.4 COMPONENTS Widgets Network Qml Quick Svg)
if (Qt5Widgets_FOUND)
message(STATUS "Will enable Qt launcher GUI")
message(STATUS " Qt5Widgets version: ${Qt5Widgets_VERSION_STRING}")
message(STATUS " Qt5Widgets include dir: ${Qt5Widgets_INCLUDE_DIRS}")
set(HAVE_QT 1)
include (Translations)
else()
# don't try to build FGQCanvas if Qt wasn't found correctly

View file

@ -13,6 +13,13 @@ else()
message(STATUS "Couldn't find translations data, will not include translated string in the executable")
endif()
find_package(Qt5 5.4 COMPONENTS LinguistTools)
if (${do_translate} AND NOT TARGET Qt5::lrelease)
set(do_translate FALSE)
message(STATUS "Built-in translations disabled becuase Qt5 lrelease tool was not found."
"\n(on Linux You may need to install an additional package containing the Qt5 translation tools)")
endif()
if (${do_translate})
# FIXME - determine this based on subdirs of TRANSLATIONS_SRC_DIR
set(LANGUAGES en_US de es nl fr it pl pt zh_CN)