CMake in l10n-kde4

Pedro Lopez-Cabanillas pedro.lopez.cabanillas at gmail.com
Sat Mar 17 12:15:40 CET 2007


On Saturday, 17 March 2007 11:20, Thomas Reitelbach wrote:
> On Donnerstag, 15. März 2007, Thomas Reitelbach wrote:
> > Hello list,
> >
> > my name is Thomas Reitelbach, i'm one of the team coordinators for german
> > translations. I'm currently preparing myself to begin translation for KDE
> > 4 and came across the currently missing build system for translators.
> >
> > Is anyone currently working on a CMake port of the build system for KDE4
> > l10n?
> >
> > Some teams have already started translation effort for KDE 4, but
> > currently we have to manually compile each PO file and copy it to it's
> > final destination, which is much work compared to the old AM based
> > system. We have to check our translations with the corresponding program
> > at runtime and thus have to install our translations.
> >
> > Can anyone tell me more about it?
>
> Hm, is no one reading this list or does nobody know anything about it?

Hi,

I'm involved in the Rosegarden project (www.rosegardenmusic.com), a KDE3 
application. We aren't yet ready for a KDE4 migration, but we have moved 
recently to CMake. 

I didn't find anything for KDE3 translations and documentation management, so 
I  wrote some macros. Perhaps somebody can review and tweak them for KDE4.

FindMSGFMT.cmake
http://rosegarden.svn.sourceforge.net/viewvc/*checkout*/rosegarden/trunk/rosegarden/cmake_admin/FindMSGFMT.cmake

It tries to find the msgfmt program, defines the following variables: 
MSGFMT_FOUND and MSGFMT_EXECUTABLE, and provides a macro: ADD_TRANSLATIONS() 
that can be used to process a po/ directory. The macro takes as the first 
argument the project base name, and then a list of ".po" files. It adds a 
"translations" custom target, and takes care of installing the resulting  
"basename.mo" files at the proper locations.

FindMEINPROC.cmake 
http://rosegarden.svn.sourceforge.net/viewvc/*checkout*/rosegarden/trunk/rosegarden/cmake_admin/FindMEINPROC.cmake

It finds the meinproc program, defines the variables MEINPROC_FOUND and  
MEINPROC_EXECUTABLE, and provides the macro: ADD_DOCS(). The macro takes as 
the first argument the project base name, and then a list of directories 
where the documents (index.docbook) and other resources reside.

Here are some samples from the Rosegarden build system. First, you  should 
include in the main CMakeLists.txt the checks for the utility programs:

	FIND_PACKAGE(MSGFMT REQUIRED)
	IF(MSGFMT_FOUND)
	    MESSAGE(STATUS "Program msgfmt found (${MSGFMT_EXECUTABLE})")
	ENDIF(MSGFMT_FOUND)

	FIND_PACKAGE(MEINPROC REQUIRED)
	IF(MEINPROC_FOUND)
	    MESSAGE(STATUS "Program meinproc found (${MEINPROC_EXECUTABLE})")
	ENDIF(MEINPROC_FOUND)

In the po/ directory you can add a CMakeLists.txt with:

	FILE(GLOB PO_FILES *.po)
	ADD_TRANSLATIONS(rosegarden ${PO_FILES})

And in your documentation directory:

	ADD_DOCS(rosegarden en es ja sv)

Where en/ es/ etc. are directories containing KDE style documentation. 
The latest Rosegarden releases (1.5.x) available at SourceForge are using  
these macros. http://sourceforge.net/projects/rosegarden/

Regards,
Pedro


More information about the Kde-buildsystem mailing list