mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-19 22:40:26 +00:00
40597c3be9
Factored out the sequence into one cmake-script. Previously it could happen that the python script failed, but the following command was successfull and so the error was hidden.
35 lines
1.1 KiB
CMake
35 lines
1.1 KiB
CMake
# -DTOP_SRC_DIR=xxx \
|
|
# -DDestFile=xxx \
|
|
# -DLYX_PYTHON_EXECUTABLE=xxx \
|
|
# -DParType=xxx \
|
|
# -DSources=xxx \
|
|
|
|
set(_dst ${DestFile})
|
|
set(type ${ParType})
|
|
set(_src_files ${Sources})
|
|
|
|
message(STATUS "Starting CreateLayoutTranslations")
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${TOP_SRC_DIR}/lib/layouttranslations" "${_dst}"
|
|
RESULT_VARIABLE _err)
|
|
string(COMPARE EQUAL ${_err} 0 _erg)
|
|
if(NOT _erg)
|
|
message(FATAL_ERROR "CreateLayoutTranslations: Copy of layouttranslations failed")
|
|
endif()
|
|
|
|
execute_process(COMMAND ${LYX_PYTHON_EXECUTABLE}
|
|
"${TOP_SRC_DIR}/po/lyx_pot.py" -b "${TOP_SRC_DIR}" -o "${_dst}" -t ${type}
|
|
"--src_file=${_src_files}"
|
|
RESULT_VARIABLE _err)
|
|
|
|
string(COMPARE EQUAL ${_err} 0 _erg)
|
|
if(NOT _erg)
|
|
message(FATAL_ERROR "CreateLayoutTranslations: Calling python wit errors")
|
|
endif()
|
|
|
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_dst}" "${TOP_SRC_DIR}/lib/layouttranslations"
|
|
RESULT_VARIABLE _err)
|
|
if(NOT _erg)
|
|
message(FATAL_ERROR "CreateLayoutTranslations: Copy of layouttranslations to source failed")
|
|
endif()
|
|
|