From: Kornel Benko Date: Tue, 10 Sep 2013 06:00:29 +0000 (+0200) Subject: Prevent build of .gmo in case of error. X-Git-Tag: 2.1.0beta2~83 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=075d90394129001651643b95887b3ffee404529c;p=lyx.git Prevent build of .gmo in case of error. Given erroneous .po file, this yields to error on first call to make. Nonetheless a new .gmo file is created. The following calls to make do not get an error. This patch prevents the .gmo creation on error. Problem spotted by Scott. --- diff --git a/development/cmake/modules/FindLyXGettext.cmake b/development/cmake/modules/FindLyXGettext.cmake index d00235e11f..d70b9bc0d8 100755 --- a/development/cmake/modules/FindLyXGettext.cmake +++ b/development/cmake/modules/FindLyXGettext.cmake @@ -51,11 +51,12 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile) ADD_CUSTOM_COMMAND( OUTPUT ${_gmoFile} COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none ${_absFile} ${_absPotFile} - COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -c --statistics -o ${_gmoFile} ${_absFile} - DEPENDS ${_absPotFile} ${_absFile} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -c --statistics -o ${_gmoFile}.1 ${_absFile} + COMMAND ${CMAKE_COMMAND} -E rename ${_gmoFile}.1 ${_gmoFile} + DEPENDS ${_absPotFile} ${_absFile} ) - INSTALL(FILES ${_gmoFile} DESTINATION ${LYX_DATA_SUBDIR}${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + INSTALL(FILES ${_gmoFile} DESTINATION ${LYX_DATA_SUBDIR}${LYX_LOCALEDIR}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) ENDFOREACH (_currentPoFile )