Create utility method to set *_DISABLE_DEPRECATED_BEFORE_AND_AT compile definitions
Open, Needs TriagePublic

Description

The current approach of defining a hex manually in the CMakeLists.txt file has a few issues:

  • A hex value is not very readable for developers
  • For the EXCLUDE_DEPRECATED_BEFORE_AND_AT value we define a tripel when configuring the project. Having to switch between the tripel and hex notations is confusing
  • Projects that don't require the latest KF5 master often define both the KF5_MIN_VERSION and the KF_DISABLE_DEPRECATED_BEFORE_AND_AT value, with a comment of keeping them in sync. Better would be to be able to reuse the KF5_MIN_VERSION value for the KF_DISABLE_DEPRECATED_BEFORE_AND_AT value.
  • The value can not get changed when configuring the project, the CMakeLists.txt file needs to be edited.

A better solution would be a function in ECM (ecm_set_deprecation_versions), which accepts multiple key-value pairs of the base name (like QT, KF, KSERVICE) and then compile definition with the given version. The version should be overwritten using a CMake definition when configuring the project.

alex created this task.Dec 17 2021, 2:04 PM

@ahmadsamir @kossebau What do you think, is the direction it goes in good?

Of course it will need more docs and some de-duplication with some of the existing code that handles the version tripels.

I promised to write such a method before, but I found myself burnt out around this things, brain always went black and I wiped any drafts the next day So cannot help here, not even with code drafts :/

Some things from my brain desk:

  • should support controlling up to which version warnings are done
  • should support the group concept (KF vs. e.g. KSERVICE, KPARTS, etc.)
  • allow to overwrite settings from cmake cmdl, e.g. to test building without latest
alex added a comment.EditedJan 9 2022, 5:55 PM

The MR landed, I will take care of porting frameworks to it

https://invent.kde.org/frameworks/kio/-/commit/aab35e6e514366e433b612636b520019b2413176
https://invent.kde.org/frameworks/krunner/-/commit/2833cd167d12d639d1cae1eb21a7dfd065227fe8
https://invent.kde.org/frameworks/kcoreaddons/commit/ed3a474e5b6d282994ada3f93e7e86e6ef998b68
https://invent.kde.org/frameworks/knewstuff/commit/c6a95ea857a8f1281525ba8bf23ca8f70849220d
https://invent.kde.org/frameworks/kconfigwidgets/commit/6ab258cf5c2832a67518f35478b5df09cc1f0b1e
https://invent.kde.org/frameworks/kglobalaccel/commit/d5956cee0c920fe823f214fa1b4f0548574b6d80
https://invent.kde.org/frameworks/kcrash/commit/b7a9cf0245ae28ab9624a5f31594b5367925da6d
https://invent.kde.org/frameworks/kcontacts/commit/58dca1dc27b52911a3bd99440d27face399a636c
https://invent.kde.org/frameworks/kservice/commit/5c562de663764379f6e8125127d55660144cc8a2
https://invent.kde.org/frameworks/kactivities/commit/21a5a09b00827dccd6e8c511d4f1df6448d45463
https://invent.kde.org/frameworks/kactivities-stats/commit/1fc5d674e9d7ae2573027e0cb7d928bfa513dfdb
https://invent.kde.org/frameworks/karchive/commit/0769648db2f5aee2c3a9cfd0ae82ad7581b2f3f7
https://invent.kde.org/frameworks/kded/commit/421df21c145323e826267ff78228d220ae214ada
https://invent.kde.org/frameworks/kbookmarks/commit/2eb34c5ca1e5587308a0533656f42f5b448994b0
https://invent.kde.org/frameworks/kcmutils/commit/a0c566286e24e7db7acd4cfa4adf6bcdb313a0c7
https://invent.kde.org/frameworks/kconfig/commit/26e541b36d25069fa829e7357aabff1a780f3872
https://invent.kde.org/frameworks/syndication/commit/2f25d93ec86d9e49944940a3821c54b647ba379d

Some apps:
https://invent.kde.org/system/dolphin/-/commit/8bc7f72a731904f4cc0669333e5db39613246e9e
https://invent.kde.org/education/kturtle/commit/9450fa1fb98d780aeb3919fea5b5b0adbac59f26