Updating CMakeLists in KDE4 repos

Stephen Kelly steveire at gmail.com
Sat Jul 25 18:30:06 UTC 2015


David Faure wrote:

> [moving this discussion to the mailing-list]
> 
>> > What should I do if it says cmake_minimum_required(VERSION 2.8.12)?
>> > Leave it untouched?
>> 
>> Perhaps someone specified that version because they used a command
>> introduced in that version, though that's not the correct thing to do.
> 
> Well, I would have done the same mistake :)
> It's quite complex that an app using a 2.8.12 cmake feature is not
> supposed to set the cmake min version to 2.8.12 but to set it to 2.8.9 due
> to kdelibs4 and abort if it's 2.8.12 (as you explain further below).
> Nobody would ever guess that in a million years.

Well, yes, in a pure sense, the cmake_minimum_required command is really 
about backward compatible behavior. I've tried to make that clear in 

 http://www.cmake.org/cmake/help/v3.3/manual/cmake-policies.7.html

over the last few releases. I might try again :).

Come to think of it we could use 

 cmake_minimum_required(VERSION 2.8.12)
 cmake_policy(VERSION 2.8.9)
 project(Foo)

to say 'error on CMake < 2.8.12, but use 2.8.9 behavior'.

>> That 2.8.12 would have been overridden by the FindKDE4Internal content
>> though, in terms of policies. If CMake 2.8.12 issued policy warnings
>> which were ignored and you leave that line untouched, those policy
>> warnings will not be issued anymore and NEW behavior will be used
>> instead. That may or may not result in an error.
>> 
>> If you intend to build these projects, you could change it to 2.8.9 and
>> run cmake on projects like that, and they don't issue warnings, then
>> they can be left with the 2.8.12.
> 
> Well I do intend to build them, but I was hoping that just checking that
> it builds would be enough. If I need to watch out for cmake warnings, how
> will I know whether my version change introduced them, or if they were
> there before? Doing a diff of the cmake warnings after/before sounds like
> a lot of work for 462 modules...

I would be surprised if the diff were different, but regardless, the 
interesting thing is whether there are warnings. If you run with

 cmake .. -DWhatever 2> $repo-stderr.txt

we can process the text files.

> I now ran the attached script, which converted everything, next step is to
> build it all :)

Aww, a script named just for me :).

>> Do you intend to build the repos you change? That would be a good
>> opportunity to find out what other policy warnings are being triggered.
> 
> There are many many (see attached), but I don't know how to fix them
> all... You could take a look at kdepimlibs, it seems to be the worst of
> all ;)

I'll take a look, thanks.

Steve.




More information about the Kde-buildsystem mailing list