1
0
Fork 0

Make translations detection more robust

Thanks to Scott Giese for the suggestion, check for a full valid
path inside the Translation setup, in case FGData exists but is not
populated.
This commit is contained in:
James Turner 2018-09-22 17:28:19 +01:00
parent eb70f5edd4
commit ca8b84dae0

View file

@ -1,11 +1,12 @@
GET_FILENAME_COMPONENT(SRC_PARENT_DIR ${PROJECT_SOURCE_DIR} PATH)
SET(FGDATA_SRC_DIR "${SRC_PARENT_DIR}/fgdata")
set(xlf_file "en_US/FlightGear-Qt.xlf")
if(EXISTS ${TRANSLATIONS_SRC_DIR})
if(EXISTS "${TRANSLATIONS_SRC_DIR}/${xlf_file}")
message(STATUS "Using explicitly defined translations from: ${TRANSLATIONS_SRC_DIR}")
set(do_translate TRUE)
elseif(EXISTS ${FGDATA_SRC_DIR})
elseif(EXISTS "${FGDATA_SRC_DIR}/Translations/${xlf_file}")
SET(TRANSLATIONS_SRC_DIR "${FGDATA_SRC_DIR}/Translations")
message(STATUS "Found translations dir implicitly: ${TRANSLATIONS_SRC_DIR}")
set(do_translate TRUE)