diff options
author | Marc-André Moreau <marcandre.moreau@gmail.com> | 2011-11-26 04:25:31 +0400 |
---|---|---|
committer | Marc-André Moreau <marcandre.moreau@gmail.com> | 2011-11-26 04:25:31 +0400 |
commit | 4386fccab2649e428a4b205213a0b0872a890ec1 (patch) | |
tree | 31ab4af3f328b711a7213e5798e8a8fd93a0ca6d | |
parent | 3a77ce46116fd9579904856b40370710a5f18311 (diff) |
cmake: add gettext macro
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | cmake/GETTEXT.cmake | 35 | ||||
-rw-r--r-- | remmina-plugins/CMakeLists.txt | 2 | ||||
-rw-r--r-- | remmina-plugins/po/CMakeLists.txt | 22 | ||||
-rw-r--r-- | remmina/CMakeLists.txt | 1 | ||||
-rw-r--r-- | remmina/po/CMakeLists.txt | 22 |
6 files changed, 87 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index dd7588bcd..fc3a4edd5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.o *.lo *.la +*.mo *.gmo *.swp *.tar.gz @@ -31,6 +32,10 @@ ltmain.sh */po/POTFILES */po/stamp-it +.project +.cproject +.settings + CMakeFiles CMakeCache.txt cmake_install.cmake diff --git a/cmake/GETTEXT.cmake b/cmake/GETTEXT.cmake new file mode 100644 index 000000000..d920a45b1 --- /dev/null +++ b/cmake/GETTEXT.cmake @@ -0,0 +1,35 @@ +# Remmina - The GTK+ Remote Desktop Client +# +# Copyright (C) 2011 Marc-Andre Moreau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307, USA. + +find_suggested_package(Gettext) + +function(gettext po_dir package_name) + set(mo_files) + file(GLOB po_files ${po_dir}/*.po) + foreach(po_file ${po_files}) + get_filename_component(lang ${po_file} NAME_WE) + set(mo_file ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo) + add_custom_command(OUTPUT ${mo_file} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${mo_file} ${po_file} DEPENDS ${po_file}) + install(FILES ${mo_file} DESTINATION share/locale/${lang}/LC_MESSAGES RENAME ${package_name}.mo) + set(mo_files ${mo_files} ${mo_file}) + endforeach() + set(translations-target "${package_name}-translations") + add_custom_target(${translations-target} ALL DEPENDS ${mo_files}) +endfunction() + diff --git a/remmina-plugins/CMakeLists.txt b/remmina-plugins/CMakeLists.txt index 01f63c70d..1ee9e1838 100644 --- a/remmina-plugins/CMakeLists.txt +++ b/remmina-plugins/CMakeLists.txt @@ -39,3 +39,5 @@ if(ZLIB_FOUND) add_subdirectory(vnc) endif() +add_subdirectory(po) + diff --git a/remmina-plugins/po/CMakeLists.txt b/remmina-plugins/po/CMakeLists.txt new file mode 100644 index 000000000..f053bad57 --- /dev/null +++ b/remmina-plugins/po/CMakeLists.txt @@ -0,0 +1,22 @@ +# po/remmina-plugins - The GTK+ Remote Desktop Client +# +# Copyright (C) 2011 Marc-Andre Moreau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307, USA. + +include(GETTEXT) +gettext(${CMAKE_CURRENT_SOURCE_DIR} "remmina-plugins") + diff --git a/remmina/CMakeLists.txt b/remmina/CMakeLists.txt index 5242e6d03..bb6f075b3 100644 --- a/remmina/CMakeLists.txt +++ b/remmina/CMakeLists.txt @@ -125,6 +125,7 @@ if(APPINDICATOR_FOUND) target_link_libraries(remmina ${APPINDICATOR_LIBRARIES}) endif() +add_subdirectory(po) add_subdirectory(icons) add_subdirectory(desktop) diff --git a/remmina/po/CMakeLists.txt b/remmina/po/CMakeLists.txt new file mode 100644 index 000000000..452e8c34d --- /dev/null +++ b/remmina/po/CMakeLists.txt @@ -0,0 +1,22 @@ +# po/remmina - The GTK+ Remote Desktop Client +# +# Copyright (C) 2011 Marc-Andre Moreau +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307, USA. + +include(GETTEXT) +gettext(${CMAKE_CURRENT_SOURCE_DIR} "remmina") + |