2 ## Compile Gettext's I18N catalogue (foo.po to out.mo)
3 ## And install to dest.
4 ## (C) 2014 K.Ohta <whatisthis.sowhat@gmail.com>
5 ## requires find_package(Gettext) befor define this.
8 cmake_minimum_required (VERSION 2.6)
10 function(compile_i18n_po_to_mo in target)
12 add_custom_target(${target} ALL
13 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${in}
14 COMMAND ${GETTEXT_MSGFMT_EXECUTABLE}
15 ${CMAKE_CURRENT_SOURCE_DIR}/${in}
16 -o ${CMAKE_CURRENT_BINARY_DIR}/messages.mo
19 endfunction(compile_i18n_po_to_mo)
22 function(install_i18n_catalogue in dest)
24 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${in}
25 ${CMAKE_CURRENT_BINARY_DIR}/messages.mo
26 DESTINATION ${dest}/LC_MESSAGES)
28 endfunction(install_i18n_catalogue)