mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Cmake build: Make sure that a sequence of commands to recreate layouttranslations failes
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.
This commit is contained in:
parent
0f4c14bba2
commit
40597c3be9
@ -43,10 +43,13 @@ macro(add_gettext_python _par _dir)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT "${_dst}"
|
||||
PRE_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${TOP_SRC_DIR}/lib/layouttranslations" "${_dst}"
|
||||
COMMAND ${LYX_PYTHON_EXECUTABLE}
|
||||
ARGS "${TOP_SRC_DIR}/po/lyx_pot.py" -b "${TOP_SRC_DIR}" -o "${_dst}" -t ${_par1} "--src_file=${_src_files}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_dst}" "${TOP_SRC_DIR}/lib/layouttranslations"
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
"-DTOP_SRC_DIR=${TOP_SRC_DIR}"
|
||||
"-DDestFile=${_dst}"
|
||||
"-DLYX_PYTHON_EXECUTABLE=${LYX_PYTHON_EXECUTABLE}"
|
||||
"-DParType=${_par1}"
|
||||
"-DSources=${_src_files}"
|
||||
-P "${TOP_SRC_DIR}/po/CreateLayoutTranslations.cmake"
|
||||
DEPENDS ${_sources} ${_src_files} "${TOP_SRC_DIR}/lib/layouttranslations"
|
||||
COMMENT "${LYX_PYTHON_EXECUTABLE} ${TOP_SRC_DIR}/po/lyx_pot.py -b ${TOP_SRC_DIR} -o ${_dst} -t ${_par1} --src_file=${_src_files}"
|
||||
)
|
||||
|
34
po/CreateLayoutTranslations.cmake
Normal file
34
po/CreateLayoutTranslations.cmake
Normal file
@ -0,0 +1,34 @@
|
||||
# -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()
|
||||
|
Loading…
Reference in New Issue
Block a user