Extend copyright to 2018.
[kdbg.git] / po / CMakeLists.txt
blob2ebc313d5b4e7f14524aad91596570a9c3ac46ec
1 FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
3 IF(NOT GETTEXT_MSGFMT_EXECUTABLE)
4         MESSAGE(
5 "------
6                 NOTE: msgfmt not found. Translations will *not* be installed
7 ------")
8 ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE)
10         SET(catalogname kdbg)
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}
22                         DEPENDS ${_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)