Backport for update_po_files target

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@34962 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Kornel Benko 2010-07-18 07:10:35 +00:00
parent b1cfb13446
commit e01e9c8a74
2 changed files with 20 additions and 3 deletions

View File

@ -46,7 +46,7 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile)
ADD_CUSTOM_COMMAND(
OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
DEPENDS ${_absPotFile} ${_absFile}
)

View File

@ -9,7 +9,7 @@ project(po)
include_directories(${TOP_SRC_DIR}/po)
SET(_lyxname ${PACKAGE})
SET(_lyxname ${LYX_PROJECT})
SET(_py_sources)
macro(add_gettext_python _par _dir)
set(_sources)
@ -105,6 +105,9 @@ ADD_CUSTOM_COMMAND(
# This makes the "svn up" on po-files work again
file(GLOB LYX_BASE_PO_FILES RELATIVE ${TOP_SRC_DIR}/po ${TOP_SRC_DIR}/po/*.po)
set(LYX_PO_FILES)
SET(LYX_UPDATED_PO_FILES)
SET(LYX_DEST_PO ${TOP_SRC_DIR}/po)
foreach(_pofile ${LYX_BASE_PO_FILES})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_pofile}
@ -114,7 +117,21 @@ foreach(_pofile ${LYX_BASE_PO_FILES})
list(APPEND LYX_PO_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_pofile})
endforeach(_pofile)
GETTEXT_CREATE_TRANSLATIONS(${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot ALL ${LYX_PO_FILES})
foreach(_pofile ${LYX_BASE_PO_FILES})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_pofile}.copied
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/${_pofile} ${LYX_DEST_PO}/${_pofile}
COMMAND ${CMAKE_COMMAND} -E touch ${_pofile}.copied
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_pofile}
)
list(APPEND LYX_UPDATED_PO_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_pofile}.copied)
endforeach(_pofile)
GETTEXT_CREATE_TRANSLATIONS(${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot ${LYX_PO_FILES})
# ALL omitted here, to prevent from automatic creation
ADD_CUSTOM_TARGET(update_po_files DEPENDS ${LYX_UPDATED_PO_FILES})
add_dependencies(update_po_files translations)
# ADD_POFILES("lyx")