View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006229CMakeCMakepublic2008-01-10 02:142008-01-22 10:11
ReporterChristian Ehrlicher 
Assigned ToClinton Stimpson 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006229: Add lupdate/lrelease (including macros to handle them) to FindQt4 (patch attached)
Descriptionin my project I need lupdate/lrelease to create translations. As FindQt4.cmake does not provide anything for this, I wrote them by myself. See attached patch.
It basically searches for lrelease/lupdate and provides two macros:
QT4_CREATE_TRANSLATION()
QT4_ADD_TRANSLATION()

QT4_CREATE_TRANSLATION creates an new target 'qt4_update_translations' to create/update foo.ts. It also calls QT4_ADD_TRANSLATION() to create foo.qm
QT4_ADD_TRANSLATION is used to only create foo.qm from foo.ts.

-->
qt4_create_translation(foo_I18N translations/foo_de.ts)
#qt4_add_translation(foo_I18N translations/foo_de.ts)
add_executable(foo ${foo_SRCS} ${foo_HDRS} ${foo_I18N})


maybe it's useful for you. If not you can maybe add it to your wiki - did not find a good example for this use case in the net
TagsNo tags attached.
Attached Filespatch file icon FindQt4.patch [^] (2,556 bytes) 2008-01-10 02:14 [Show Content]
patch file icon FindQt4_20080117.patch [^] (3,776 bytes) 2008-01-17 03:56 [Show Content]
patch file icon FindQt4-translation.cmake.patch [^] (3,773 bytes) 2008-01-18 10:54 [Show Content]

 Relationships

  Notes
(0010138)
Christian Ehrlicher (reporter)
2008-01-11 07:05

I just found out that I made a small mistake:
foo_I18N should be renamed to foo_SRCS - it must contain the sources from where lupdate should get the strings to translate from.
(0010140)
Clinton Stimpson (developer)
2008-01-11 12:48

Thanks for the patch.

I'm curious what you think of modifying QT4_CREATE_TRANSLATION so that it returns the output file(s). Which allows the user to create the custom target with whatever name they wish, or to use the output file(s) in some other way.
(0010146)
Christian Ehrlicher (reporter)
2008-01-12 03:59

I thought about this too and will see if I can create a patch for this next week.
(0010164)
Christian Ehrlicher (reporter)
2008-01-17 03:56

Ok, here a new patch, also added comments for the two macros.
(0010186)
Clinton Stimpson (developer)
2008-01-18 11:00

I made some adjustments, because I thought it a bit awkward how the sources were passed in. Can you look it over and see if I missed anything?
(0010207)
Christian Ehrlicher (reporter)
2008-01-22 03:04

looks fine to me.
(0010209)
Clinton Stimpson (developer)
2008-01-22 10:11

/cvsroot/CMake/CMake/Modules/FindQt4.cmake,v <-- FindQt4.cmake
new revision: 1.86; previous revision: 1.85

 Issue History
Date Modified Username Field Change
2008-01-10 02:14 Christian Ehrlicher New Issue
2008-01-10 02:14 Christian Ehrlicher File Added: FindQt4.patch
2008-01-10 16:15 Alex Neundorf Status new => assigned
2008-01-10 16:15 Alex Neundorf Assigned To => Clinton Stimpson
2008-01-11 07:05 Christian Ehrlicher Note Added: 0010138
2008-01-11 12:48 Clinton Stimpson Note Added: 0010140
2008-01-12 03:59 Christian Ehrlicher Note Added: 0010146
2008-01-17 03:56 Christian Ehrlicher File Added: FindQt4_20080117.patch
2008-01-17 03:56 Christian Ehrlicher Note Added: 0010164
2008-01-18 10:54 Clinton Stimpson File Added: FindQt4-translation.cmake.patch
2008-01-18 11:00 Clinton Stimpson Note Added: 0010186
2008-01-22 03:04 Christian Ehrlicher Note Added: 0010207
2008-01-22 10:11 Clinton Stimpson Status assigned => closed
2008-01-22 10:11 Clinton Stimpson Note Added: 0010209
2008-01-22 10:11 Clinton Stimpson Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team