summaryrefslogtreecommitdiff
path: root/po
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-05-21 16:30:04 +0000
committerSebastien Helleu <flashcode@flashtux.org>2007-05-21 16:30:04 +0000
commit9f5d99f57e614195c65eeb9b663dc1bd8d5b1dc9 (patch)
treebddb2e678b06930ec965ecb8ba107d54900db874 /po
parentc79becdc8502c6839757eb4417ec2b8ec332b428 (diff)
downloadweechat-9f5d99f57e614195c65eeb9b663dc1bd8d5b1dc9.zip
Added cmake for weechat compile
Diffstat (limited to 'po')
-rw-r--r--po/CMakeLists.txt77
-rw-r--r--po/srcfiles.cmake82
2 files changed, 159 insertions, 0 deletions
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644
index 000000000..19629a0f5
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1,77 @@
+# Copyright (c) 2003-2007 FlashCode <flashcode@flashtux.org>
+#
+# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+SET(PO_FILES
+ fr.po
+ es.po
+ cs.po
+ hu.po
+ de.po
+ ru.po
+ )
+
+SET(COPYRIGHT_HOLDER "WeeChat Team")
+SET(BUGS_ADDRESS "flashcode@flashtux.org")
+SET(POT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pot)
+
+INCLUDE(srcfiles.cmake)
+
+# Looking for xgettext, msgmerge and msgfmt
+FIND_PROGRAM(XGETTEXT_EXECUTABLE xgettext)
+FIND_PROGRAM(MSGMERGE_EXECUTABLE msgmerge)
+FIND_PROGRAM(MSGFMT_EXECUTABLE msgfmt)
+
+IF(XGETTEXT_EXECUTABLE AND MSGMERGE_EXECUTABLE AND MSGFMT_EXECUTABLE)
+
+ # Create PO template file weechat.pot
+ SET(SRC_FILES)
+ SET(POT_DEPENDS)
+
+ FOREACH(srcfile ${WEECHAT_SOURCES})
+ SET(SRC_FILES ${SRC_FILES} ${srcfile})
+ SET(POT_DEPENDS ${POT_DEPENDS} ${CMAKE_SOURCE_DIR}/${srcfile})
+ ENDFOREACH(srcfile ${WEECHAT_SOURCES})
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${POT_FILE}
+ COMMAND ${XGETTEXT_EXECUTABLE}
+ ARGS -o ${POT_FILE} --keyword='_' --keyword='N_' --directory=${CMAKE_SOURCE_DIR} --omit-header --msgid-bugs-address=${BUGS_ADDRESS} --copyright-holder=${COPYRIGHT_HOLDER} ${SRC_FILES}
+ DEPENDS ${POT_DEPENDS}
+ COMMENT "Generating PO template file"
+ )
+
+ # Update .po files and compile them to binary .gmo files
+
+ SET(GMO_FILES)
+ FOREACH(pofile ${PO_FILES})
+ GET_FILENAME_COMPONENT(polang ${pofile} NAME_WE)
+
+ SET(gmofile ${CMAKE_CURRENT_BINARY_DIR}/${polang}.gmo)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${gmofile}
+ COMMAND ${MSGMERGE_EXECUTABLE} ARGS --quiet -s -o ${CMAKE_CURRENT_BINARY_DIR}/${pofile} ${CMAKE_CURRENT_SOURCE_DIR}/${pofile} ${POT_FILE}
+ COMMAND ${MSGFMT_EXECUTABLE} ARGS -o ${gmofile} ${CMAKE_CURRENT_BINARY_DIR}/${pofile}
+ DEPENDS ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${pofile}
+ COMMENT "Compiling locales (${polang})"
+ )
+
+ INSTALL(FILES ${gmofile} DESTINATION share/locale/${polang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+ SET(GMO_FILES ${GMO_FILES} ${gmofile})
+ ENDFOREACH(pofile ${PO_FILES})
+ ADD_CUSTOM_TARGET(translations ALL DEPENDS ${GMO_FILES})
+
+ENDIF(XGETTEXT_EXECUTABLE AND MSGMERGE_EXECUTABLE AND MSGFMT_EXECUTABLE)
diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake
new file mode 100644
index 000000000..8c368f10d
--- /dev/null
+++ b/po/srcfiles.cmake
@@ -0,0 +1,82 @@
+SET(WEECHAT_SOURCES
+src/irc/irc-mode.c
+src/irc/irc-nick.c
+src/irc/irc-server.c
+src/irc/irc-channel.c
+src/irc/irc-commands.c
+src/irc/irc-display.c
+src/irc/irc-send.c
+src/irc/irc-recv.c
+src/irc/irc-dcc.c
+src/irc/irc-ignore.c
+src/irc/irc.h
+src/plugins/plugins.c
+src/plugins/plugins.h
+src/plugins/plugins-config.c
+src/plugins/plugins-config.h
+src/plugins/plugins-interface.c
+src/plugins/weechat-plugin.h
+src/gui/curses/gui-curses-chat.c
+src/gui/curses/gui-curses-color.c
+src/gui/curses/gui-curses-infobar.c
+src/gui/curses/gui-curses-input.c
+src/gui/curses/gui-curses-keyboard.c
+src/gui/curses/gui-curses-main.c
+src/gui/curses/gui-curses-nicklist.c
+src/gui/curses/gui-curses-panel.c
+src/gui/curses/gui-curses-status.c
+src/gui/curses/gui-curses-window.c
+src/gui/curses/gui-curses.h
+src/gui/gtk/gui-gtk-chat.c
+src/gui/gtk/gui-gtk-color.c
+src/gui/gtk/gui-gtk-infobar.c
+src/gui/gtk/gui-gtk-input.c
+src/gui/gtk/gui-gtk-keyboard.c
+src/gui/gtk/gui-gtk-main.c
+src/gui/gtk/gui-gtk-nicklist.c
+src/gui/gtk/gui-gtk-panel.c
+src/gui/gtk/gui-gtk-status.c
+src/gui/gtk/gui-gtk-window.c
+src/gui/gtk/gui-gtk.h
+src/gui/gui-action.c
+src/gui/gui-buffer.c
+src/gui/gui-common.c
+src/gui/gui-keyboard.c
+src/gui/gui-log.c
+src/gui/gui-panel.c
+src/gui/gui-window.c
+src/gui/gui.h
+src/gui/gui-buffer.h
+src/gui/gui-color.h
+src/gui/gui-keyboard.h
+src/gui/gui-panel.h
+src/gui/gui-window.h
+src/common/alias.c
+src/common/alias.h
+src/common/backtrace.c
+src/common/backtrace.h
+src/common/command.c
+src/common/command.h
+src/common/completion.c
+src/common/completion.h
+src/common/fifo.c
+src/common/fifo.h
+src/common/history.c
+src/common/history.h
+src/common/hotlist.c
+src/common/hotlist.h
+src/common/log.c
+src/common/log.h
+src/common/session.c
+src/common/session.h
+src/common/utf8.c
+src/common/utf8.h
+src/common/util.c
+src/common/util.h
+src/common/weechat.c
+src/common/weechat.h
+src/common/weeconfig.c
+src/common/weeconfig.h
+src/common/weelist.c
+src/common/weelist.h
+)