summaryrefslogtreecommitdiffstats
path: root/kdialogd3/po/CMakeLists.txt
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-09 20:27:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-09 20:27:19 +0000
commitc6ca83d07d95e076b09bd802f66ba72d363b0235 (patch)
treef13000febb0c9c5a5da621b4bba53ba3eace022e /kdialogd3/po/CMakeLists.txt
downloadkgtk-qt3-c6ca83d07d95e076b09bd802f66ba72d363b0235.tar.gz
kgtk-qt3-c6ca83d07d95e076b09bd802f66ba72d363b0235.zip
* Added kgtk-qt3
* Slight kpowersave message cleanup git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kgtk-qt3@1173604 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdialogd3/po/CMakeLists.txt')
-rw-r--r--kdialogd3/po/CMakeLists.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/kdialogd3/po/CMakeLists.txt b/kdialogd3/po/CMakeLists.txt
new file mode 100644
index 0000000..3f456de
--- /dev/null
+++ b/kdialogd3/po/CMakeLists.txt
@@ -0,0 +1,41 @@
+find_package(Msgfmt REQUIRED)
+
+# .po to .gmo stuff
+file(GLOB _pofiles *.po)
+
+foreach(_file ${_pofiles})
+ get_filename_component(_file_we ${_file} NAME_WE)
+ set(_out "${CMAKE_CURRENT_BINARY_DIR}/${_file_we}.gmo")
+ set(_in "${_file_we}.po")
+ add_custom_command(OUTPUT ${_out} COMMAND ${MSGFMT_EXECUTABLE} -o ${_out} ${_file} DEPENDS ${_file})
+ install(FILES ${_out} DESTINATION share/locale/${_file_we}/LC_MESSAGES/ RENAME kdialogd3.mo)
+ set(_outputs ${_outputs} ${_out})
+endforeach(_file)
+
+add_custom_target(pofiles ALL DEPENDS ${_outputs})
+
+# Stuff to generate the .pot
+set(POT_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../kdialogd.cpp)
+set(POT_OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/kdialogd3.pot)
+
+# Find xgettext
+find_program(XGETTEXT_PATH NAMES "xgettext" PATHS "/usr/bin" "/usr/local/bin")
+if(${XGETTEXT_PATH} STREQUAL "XGETTEXT_PATH-NOTFOUND")
+ message(STATUS "xgettext not found. You will not be able to run 'make extract_messages' in the 'po' directory.")
+else(${XGETTEXT_PATH} STREQUAL "XGETTEXT_PATH-NOTFOUND")
+ message(STATUS "Found xgettext: ${XGETTEXT_PATH}")
+endif(${XGETTEXT_PATH} STREQUAL "XGETTEXT_PATH-NOTFOUND")
+
+if(EXISTS ${KDE3_INCLUDE_DIR}/kde.pot)
+ add_custom_command(
+ OUTPUT ${POT_OUTPUT}
+ COMMAND ${XGETTEXT_PATH} --foreign-user -C -ci18n -ki18n -ktr2i18n -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -x "${KDE3_INCLUDE_DIR}/kde.pot" -o ${POT_OUTPUT} ${POT_SOURCES}
+ )
+else (EXISTS ${KDE3_INCLUDE_DIR}/kde.pot)
+ add_custom_command(
+ OUTPUT ${POT_OUTPUT}
+ COMMAND ${XGETTEXT_PATH} --foreign-user -C -ci18n -ki18n -ktr2i18n -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -o ${POT_OUTPUT} ${POT_SOURCES}
+ )
+endif (EXISTS ${KDE3_INCLUDE_DIR}/kde.pot)
+
+add_custom_target(extract_messages DEPENDS ${POT_OUTPUT})