Fix warnings about deprecated install dirs
Needs RevisionPublic

Authored by dinoh on Sep 27 2018, 12:06 PM.

Details

Reviewers
apol
dfaure
bruns
Summary

KDEInstallDirs.cmake used the deprecated format for install dirs internally and thus caused a bunch of warnings, which are fixed by this patch.

Diff Detail

Repository
R240 Extra CMake Modules
Lint
Lint Skipped
Unit
Unit Tests Skipped
dinoh created this revision.Sep 27 2018, 12:06 PM
Restricted Application added projects: Frameworks, Build System. · View Herald TranscriptSep 27 2018, 12:06 PM
Restricted Application added subscribers: kde-buildsystem, kde-frameworks-devel. · View Herald Transcript
dinoh requested review of this revision.Sep 27 2018, 12:06 PM
ltoscano added inline comments.
kde-modules/KDEInstallDirs.cmake
564

I'm going to comment only on this, but the others (most, if not all) are the same. If you check the definition of _define_relative, this parameter is:

oldstylename (optional): the old-style name of the variable

So this command is exactly defining the old variable in addition to the new one.
We can't remove the definition of the old variables until they are in use, and for sure not during the lifetime of Frameworks 5.x.

Unless of course I misunderstood the code...

dinoh added inline comments.Sep 27 2018, 3:33 PM
kde-modules/KDEInstallDirs.cmake
564

Hmm, you're right, but then it shouldn't come up with a warning...?

In the _define_relative macro we have:

if(KDE_INSTALL_${varname})
    ...
elseif(${_oldstylename})
    if(NOT CMAKE_VERSION VERSION_LESS 3.0.0)
        message(DEPRECATION "${_oldstylename} is deprecated, use KDE_INSTALL_${varname} instead.")

In my case the message was triggered for all definitions.

bruns resigned from this revision.Oct 16 2018, 11:02 PM

sorry, busy with other stuff

apol added a comment.Feb 20 2019, 5:21 PM

Has this been fixed? I haven't seen these warnings

dfaure requested changes to this revision.Mar 3 2019, 12:20 AM

The warning needs to be removed then. We can't really warn at the time of using a variable.

This revision now requires changes to proceed.Mar 3 2019, 12:20 AM