[kdelibs/KDE/4.7] cmake/modules: Do not use GET_FILENAME_COMPONENT + NAME_WE to get the base filename

Albert Astals Cid aacid at kde.org
Tue Nov 15 18:08:26 UTC 2011


A Dimarts, 15 de novembre de 2011, Alexander Neundorf vàreu escriure:
> On Tuesday 15 November 2011, Albert Astals Cid wrote:
> > Git commit 9872a43e854aa28c5ef4bcfe9d20e3c210f0ba7e by Albert Astals
> > Cid.
> > Committed on 15/11/2011 at 01:09.
> > Pushed by aacid into branch 'KDE/4.7'.
> > 
> > Do not use GET_FILENAME_COMPONENT + NAME_WE to get the base filename
> > 
> > The problem is that NAME_WE treats everything after the first dot as
> > file
> > extension but we know the extension will just be .po so in case of a
> > file
> > named plasma_package_org.kde.activityswitcher.po
> > we want
> > plasma_package_org.kde.activityswitcher to be the basename and not
> > plasma_package_org
> > 
> > I am pretty sure GETTEXT_PROCESS_POT_FILE and
> > GETTEXT_CREATE_TRANSLATIONS
> > macros have a similar problem but since we do not use them in KDE I have
> > no way to test it in a meaningful way
> 
> It would be nice nevertheless if you could give those two macros also a try,
> check whether they do what is expected and maybe provide a patch.
> You know much more about this than I or anybody else at least on kde-
> buildsystem does (AFAIK).

Sincerely I have not the slightest idea of what they do. I could reverse 
engineer its meaning from the code, but revese engineering cmake code is not 
something i personally like to do.

You could contact the original author, or simply replace both the
   GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
with
   GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
   STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})

And that should work, but as I'm totally clueless on which situation they are 
supposed to be used I can not guarantee it will work 100%

Albert

> 
> Thanks
> Alex


More information about the Kde-buildsystem mailing list