diff --git a/development/cmake/modules/FindLyXGettext.cmake b/development/cmake/modules/FindLyXGettext.cmake index 8533cbf84c..61ccc8fd72 100755 --- a/development/cmake/modules/FindLyXGettext.cmake +++ b/development/cmake/modules/FindLyXGettext.cmake @@ -17,6 +17,7 @@ FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge ${hints}) FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt ${hints}) FIND_PROGRAM(GETTEXT_XGETTEXT_EXECUTABLE xgettext ${hints}) FIND_PROGRAM(GETTEXT_MSGUNIQ_EXECUTABLE msguniq ${hints}) +FIND_PROGRAM(GETTEXT_MSGCAT_EXECUTABLE msgcat ${hints}) MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile) @@ -76,5 +77,5 @@ ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) ENDIF (GetText_REQUIRED) ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) -mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE GETTEXT_XGETTEXT_EXECUTABLE GETTEXT_MSGUNIQ_EXECUTABLE) +mark_as_advanced(GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE GETTEXT_XGETTEXT_EXECUTABLE GETTEXT_MSGUNIQ_EXECUTABLE GETTEXT_MSGCAT_EXECUTABLE) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index fd14bd2546..065448e6e5 100755 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -104,9 +104,9 @@ add_gettext_python(encodings lib encodings) add_gettext_python(ui lib/ui *.ui *.inc) add_gettext_python(external lib/xtemplates *.xtemplate) add_gettext_python(formats lib configure.py) -add_gettext_python(examples_templates lib examples/[a-zA-Z]* templates/[a-zA-Z]*) add_gettext_python(tabletemplates lib tabletemplates/*.lyx) add_gettext_python(qt src/frontends/qt/ui *.ui) +add_gettext_python(examples_templates lib examples/[a-zA-Z]* templates/[a-zA-Z]*) ADD_CUSTOM_COMMAND( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.cat.pot" @@ -145,20 +145,37 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_BINARY_DIR}/POTFILES.in.tmp" "${CMAKE_CURRENT_BINARY_DIR}/POTFILES.in" ) -ADD_CUSTOM_COMMAND( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.fmt.pot" "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" - COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} - --from-code=UTF-8 - --default-domain=${_lyxname} --directory=${TOP_SRC_DIR} - --add-comments=TRANSLATORS: - --language=C++ --join-existing --keyword=_ --keyword=N_ --keyword=B_ --keyword=qt_ - --files-from=${CMAKE_CURRENT_BINARY_DIR}/POTFILES.in - --copyright-holder="LyX Developers" --msgid-bugs-address=lyx-devel@lists.lyx.org - -o "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.fmt.pot" ${_potfiles_dep} - ) +if (GETTEXT_MSGCAT_EXECUTABLE) + ADD_CUSTOM_COMMAND( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" + COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} + --from-code=UTF-8 + --default-domain=${_lyxname} --directory=${TOP_SRC_DIR} + --add-comments=TRANSLATORS: + --language=C++ --keyword=_ --keyword=N_ --keyword=B_ --keyword=qt_ + --files-from=${CMAKE_CURRENT_BINARY_DIR}/POTFILES.in + --copyright-holder="LyX Developers" --msgid-bugs-address=lyx-devel@lists.lyx.org + -o "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.src.pot" + COMMAND ${GETTEXT_MSGCAT_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.src.pot" "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.fmt.pot" -o "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.fmt.pot" ${_potfiles_dep} + ) +else() + ADD_CUSTOM_COMMAND( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" + COMMAND ${CMAKE_COMMAD} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.fmt.pot" "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" + COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} + --from-code=UTF-8 + --default-domain=${_lyxname} --directory=${TOP_SRC_DIR} + --add-comments=TRANSLATORS: + --language=C++ --join-existing --keyword=_ --keyword=N_ --keyword=B_ --keyword=qt_ + --files-from=${CMAKE_CURRENT_BINARY_DIR}/POTFILES.in + --copyright-holder="LyX Developers" --msgid-bugs-address=lyx-devel@lists.lyx.org + -o "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.pot" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_lyxname}.fmt.pot" ${_potfiles_dep} + ) + +endif() # # We have to copy the po-files first, # otherwise they would be modified (inside the macro GETTEXT_CREATE_TRANSLATIONS())