[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r2189: Create a 'make translations' target to run lrelease on each (in trunk: . src/vidalia src/vidalia/i18n)
Author: edmanm
Date: 2007-12-06 21:52:20 -0500 (Thu, 06 Dec 2007)
New Revision: 2189
Added:
trunk/VidaliaMacros.cmake
trunk/src/vidalia/i18n/CMakeLists.txt
Modified:
trunk/
trunk/CMakeLists.txt
trunk/src/vidalia/CMakeLists.txt
Log:
r2254@lysithea: edmanm | 2007-12-06 21:52:14 -0500
Create a 'make translations' target to run lrelease on each of the .ts
files, and add a build dependency so they're generated automatically.
Property changes on: trunk
___________________________________________________________________
svk:merge ticket from /local/vidalia/trunk [r2254] on 0108964c-5b0b-4c9e-969f-e2288315d100
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2007-12-06 19:55:34 UTC (rev 2188)
+++ trunk/CMakeLists.txt 2007-12-07 02:52:20 UTC (rev 2189)
@@ -37,6 +37,7 @@
set(QT_USE_QTNETWORK true)
set(QT_USE_QTXML true)
include(${QT_USE_FILE})
+include(VidaliaMacros.cmake)
## Add the actual source directories
add_subdirectory(src)
Added: trunk/VidaliaMacros.cmake
===================================================================
--- trunk/VidaliaMacros.cmake (rev 0)
+++ trunk/VidaliaMacros.cmake 2007-12-07 02:52:20 UTC (rev 2189)
@@ -0,0 +1,49 @@
+#####################################################################
+# $Id$
+#
+# Vidalia is distributed under the following license:
+#
+# Copyright (C) 2006-2007, Matt Edman, Justin Hipple
+#
+# 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 Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#####################################################################
+
+
+## Search for lrelease
+find_program(lrelease_CMD NAMES lrelease lrelease-qt4 ${QT_BINARY_DIR})
+if (NOT lrelease_CMD)
+ message(FATAL_ERROR
+ "Vidalia could not find lrelease. Please make sure Qt >= 4.1 is installed."
+ )
+endif(NOT lrelease_CMD)
+
+
+## Wraps the supplied .ts files in lrelease commands
+macro(QT4_ADD_TRANSLATIONS outfiles)
+ foreach (it ${ARGN})
+ get_filename_component(it ${it} ABSOLUTE)
+ get_filename_component(outfile ${it} NAME_WE)
+
+ set(outfile ${CMAKE_CURRENT_BINARY_DIR}/${outfile}.qm)
+ add_custom_command(OUTPUT ${outfile}
+ COMMAND ${lrelease_CMD}
+ ARGS -compress -silent -nounfinished ${it} -qm ${outfile}
+ MAIN_DEPENDENCY ${it}
+ )
+ set(${outfiles} ${${outfiles}} ${outfile})
+ endforeach(it)
+endmacro(QT4_ADD_TRANSLATIONS)
+
Property changes on: trunk/VidaliaMacros.cmake
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: trunk/src/vidalia/CMakeLists.txt
===================================================================
--- trunk/src/vidalia/CMakeLists.txt 2007-12-06 19:55:34 UTC (rev 2188)
+++ trunk/src/vidalia/CMakeLists.txt 2007-12-07 02:52:20 UTC (rev 2189)
@@ -29,6 +29,9 @@
${CMAKE_CURRENT_SOURCE_DIR}/help/browser
)
+## Process the translation files
+add_subdirectory(i18n)
+
## About dialog sources
set(vidalia_SRCS
about/aboutdialog.cpp
@@ -223,6 +226,7 @@
add_executable(vidalia ${vidalia_SRCS})
endif(WIN32)
endif(APPLE)
+add_dependencies(vidalia translations)
## Link to the Qt libraries and other libraries built as a part of Vidalia
target_link_libraries(vidalia
Added: trunk/src/vidalia/i18n/CMakeLists.txt
===================================================================
--- trunk/src/vidalia/i18n/CMakeLists.txt (rev 0)
+++ trunk/src/vidalia/i18n/CMakeLists.txt 2007-12-07 02:52:20 UTC (rev 2189)
@@ -0,0 +1,48 @@
+#####################################################################
+# $Id$
+#
+# Vidalia is distributed under the following license:
+#
+# Copyright (C) 2006-2007, Matt Edman, Justin Hipple
+#
+# 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 Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#####################################################################
+
+
+## Vidalia translation files
+qt4_add_translations(vidalia_QMS
+ vidalia_ar.ts
+ vidalia_bg.ts
+ vidalia_cs.ts
+ vidalia_de.ts
+ vidalia_en.ts
+ vidalia_es.ts
+ vidalia_fa.ts
+ vidalia_fi.ts
+ vidalia_fr.ts
+ vidalia_hu.ts
+ vidalia_it.ts
+ vidalia_nb.ts
+ vidalia_nl.ts
+ vidalia_pl.ts
+ vidalia_pt.ts
+ vidalia_ru.ts
+ vidalia_sv.ts
+ vidalia_zh-cn.ts
+ vidalia_zh-tw.ts
+)
+add_custom_target(translations ALL DEPENDS ${vidalia_QMS})
+
Property changes on: trunk/src/vidalia/i18n/CMakeLists.txt
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native