]> git.lyx.org Git - features.git/blob - po/CreateLayoutTranslations.cmake
Cmake build: Make sure that a sequence of commands to recreate layouttranslations...
[features.git] / po / CreateLayoutTranslations.cmake
1 # -DTOP_SRC_DIR=xxx \
2 # -DDestFile=xxx \
3 # -DLYX_PYTHON_EXECUTABLE=xxx \
4 # -DParType=xxx \
5 # -DSources=xxx \
6
7 set(_dst ${DestFile})
8 set(type ${ParType})
9 set(_src_files ${Sources})
10
11 message(STATUS "Starting CreateLayoutTranslations")
12 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${TOP_SRC_DIR}/lib/layouttranslations" "${_dst}"
13   RESULT_VARIABLE _err)
14 string(COMPARE EQUAL  ${_err} 0 _erg)
15 if(NOT _erg)
16   message(FATAL_ERROR "CreateLayoutTranslations: Copy of layouttranslations failed")
17 endif()
18
19 execute_process(COMMAND ${LYX_PYTHON_EXECUTABLE}
20   "${TOP_SRC_DIR}/po/lyx_pot.py" -b "${TOP_SRC_DIR}" -o "${_dst}" -t ${type}
21   "--src_file=${_src_files}"
22   RESULT_VARIABLE _err)
23
24 string(COMPARE EQUAL  ${_err} 0 _erg)
25 if(NOT _erg)
26   message(FATAL_ERROR "CreateLayoutTranslations: Calling python wit errors")
27 endif()
28
29 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_dst}" "${TOP_SRC_DIR}/lib/layouttranslations"
30   RESULT_VARIABLE _err)
31 if(NOT _erg)
32   message(FATAL_ERROR "CreateLayoutTranslations: Copy of layouttranslations to source failed")
33 endif()
34