1 FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
3 IF(NOT GETTEXT_MSGFMT_EXECUTABLE)
6 NOTE: msgfmt not found. Translations will *not* be installed
8 ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE)
12 ADD_CUSTOM_TARGET(translations ALL)
14 FILE(GLOB PO_FILES *.po)
16 FOREACH(_poFile ${PO_FILES})
17 GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE)
18 SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
20 ADD_CUSTOM_COMMAND(TARGET translations
21 COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile}
23 INSTALL(FILES ${_gmoFile}
24 DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/
25 RENAME ${catalogname}.mo)
27 ENDFOREACH(_poFile ${PO_FILES})
29 ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE)