mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 10:37:37 -07:00
Merge pull request #3091
64f36300
Check if lrelease is working before trying to use it (Guillaume LE VAILLANT)
This commit is contained in:
commit
35d5aa36c9
@ -37,14 +37,21 @@ if(LRELEASE STREQUAL "LRELEASE-NOTFOUND")
|
|||||||
set(ts_files "")
|
set(ts_files "")
|
||||||
message(WARNING "lrelease program not found, translation files not built")
|
message(WARNING "lrelease program not found, translation files not built")
|
||||||
else()
|
else()
|
||||||
file(GLOB ts_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.ts)
|
execute_process(COMMAND ${LRELEASE} -version
|
||||||
foreach(ts_file ${ts_files})
|
RESULT_VARIABLE lrelease_ret)
|
||||||
string(REPLACE ".ts" ".qm" qm_file "${ts_file}")
|
if(NOT lrelease_ret EQUAL "0")
|
||||||
add_custom_command(TARGET generate_translations_header
|
set(ts_files "")
|
||||||
PRE_BUILD
|
message(WARNING "lrelease program not working, translation files not built")
|
||||||
COMMAND ${LRELEASE} "${CMAKE_CURRENT_SOURCE_DIR}/${ts_file}" -qm "${qm_file}"
|
else()
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BIN_DIR}")
|
file(GLOB ts_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" *.ts)
|
||||||
endforeach()
|
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()
|
endif()
|
||||||
|
|
||||||
string(REPLACE ".ts" ".qm" qm_files "${ts_files}")
|
string(REPLACE ".ts" ".qm" qm_files "${ts_files}")
|
||||||
|
Loading…
Reference in New Issue
Block a user