Proposal to change kdelibs/cmake/modules/FindGettext.cmake

Alexander Neundorf neundorf at kde.org
Tue May 25 22:36:45 CEST 2010


On Thursday 20 May 2010, Thomas Baumgart wrote:
> Hi,
>
> on Thursday 20 May 2010 Alexander Neundorf wrote:
> > On Thursday 20 May 2010, you wrote:
> > > Hi guys,
> > >
> > > we - the KMyMoney team - ran into a problem with the current switch to
> > > cmake 2.6.4 and the tarballs generated by the createtarball script.
> > >
> > > The problem is, that of cmake 2.6.4 no duplicate targets are allowed
> > > w/o turning off policy CMP0002. Turning off the policy could serve a
> > > work-around on a per project basis, but a cleaner solution would be to
> > > fix FindGettext.cmake.
> >
> > In FindKDE4Internal.cmake CMP0002 is set to OLD.
> > Somehow you seem to be setting it to NEW or WARN again.
> > Do you maybe have a cmake_minimum_required(VERSION ... ) somewhere after
> > find_package(KDE4) ?
>
> No (at least I don't see it). We have
>
>   CMAKE_MINIMUM_REQUIRED(VERSION 2.6.4)
>   cmake_policy(SET CMP0002 OLD)
>   FIND_PACKAGE(KDE4 REQUIRED)
>
> in that order (with some other unrelated stuff in between). It used to work
> with
>
>   CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
>   FIND_PACKAGE(KDE4 REQUIRED)
>
> (w/o our own cmake_policy statement), but we require cmake 2.6.4 in order
> to use "find_package(KdepimLibs REQUIRED)" successfully (at least from what
> I found out).
>
> So I though I add that version as the minimum requirement to help
> packagers/developers but that started causing the problems with the
> translations.

Ok, this must be CMP0011:
http://www.cmake.org/Wiki/CMake_2.6.4_Docs

which was introduced in CMake 2.6.3.

To verify, can you please check how it behaves if you say "VERSION 2.6.2" in 
your toplevel CMakeLists.txt ?

The cmake_minimum_required() call also adjusts the policies to the specified 
version.
So by saying "2.6.4" you probably say that the policies set in 
FindKDE4Internal.cmake don't apply to the project which does 
find_package(KDE4)

except if it would do 
find_package(KDE4 NO_POLICY_SCOPE)
if I understand correctly.

Or I could move the policy settings from FindKDE4Internal.cmake to 
KDE4Defaults.cmake, then you could do 
include(KDE4Defaults NO_POLICY_SCOPE)
but I actually also doubt that most developers will find that out.

Alex


More information about the Kde-buildsystem mailing list