aboutsummaryrefslogtreecommitdiff
path: root/translations/CMakeLists.txt
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-01-10 11:56:11 +0100
committerRiccardo Spagni <ric@spagni.net>2018-01-10 11:56:11 +0100
commit35d5aa36c9b2f4bba169e5947039bf7871649ee1 (patch)
tree8109df08f1f0c2d820e76324ad563ad3d11a833b /translations/CMakeLists.txt
parentMerge pull request #3063 (diff)
parentCheck if lrelease is working before trying to use it (diff)
downloadmonero-35d5aa36c9b2f4bba169e5947039bf7871649ee1.tar.xz
Merge pull request #3091
64f36300 Check if lrelease is working before trying to use it (Guillaume LE VAILLANT)
Diffstat (limited to 'translations/CMakeLists.txt')
-rw-r--r--translations/CMakeLists.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/translations/CMakeLists.txt b/translations/CMakeLists.txt
index f74e63c76..a069daea9 100644
--- a/translations/CMakeLists.txt
+++ b/translations/CMakeLists.txt
@@ -37,14 +37,21 @@ if(LRELEASE STREQUAL "LRELEASE-NOTFOUND")
set(ts_files "")
message(WARNING "lrelease program not found, translation files not built")
else()
- file(GLOB ts_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.ts)
- foreach(ts_file ${ts_files})
- string(REPLACE ".ts" ".qm" qm_file "${ts_file}")
- add_custom_command(TARGET generate_translations_header
- PRE_BUILD
- COMMAND ${LRELEASE} "${CMAKE_CURRENT_SOURCE_DIR}/${ts_file}" -qm "${qm_file}"
- WORKING_DIRECTORY "${CMAKE_CURRENT_BIN_DIR}")
- endforeach()
+ execute_process(COMMAND ${LRELEASE} -version
+ RESULT_VARIABLE lrelease_ret)
+ if(NOT lrelease_ret EQUAL "0")
+ set(ts_files "")
+ message(WARNING "lrelease program not working, translation files not built")
+ else()
+ file(GLOB ts_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.ts)
+ foreach(ts_file ${ts_files})
+ string(REPLACE ".ts" ".qm" qm_file "${ts_file}")
+ add_custom_command(TARGET generate_translations_header
+ PRE_BUILD
+ COMMAND ${LRELEASE} "${CMAKE_CURRENT_SOURCE_DIR}/${ts_file}" -qm "${qm_file}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BIN_DIR}")
+ endforeach()
+ endif()
endif()
string(REPLACE ".ts" ".qm" qm_files "${ts_files}")