D22698: Support passing target to ki18n_wrap_ui macro

Daan De Meyer noreply at phabricator.kde.org
Tue Jul 23 20:11:34 BST 2019


daandemeyer created this revision.
daandemeyer added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
daandemeyer requested review of this revision.

REVISION SUMMARY
  Modern CMake encourages using targets as much as possible instead of macros. This patch makes it possible to pass a target to `ki18n_wrap_ui`. Instead of adding the resulting header to the list of sources, the header is added directly to the target's sources using the `target_sources` command which was added in CMake 3.1. Specific usage of this functionality is as a result also guarded by a call to `cmake_minimum_required`. The change is backwards compatible and allows projects to move over incrementally to passing targets to `ki18n_wrap_ui` instead of source lists.

TEST PLAN
  Tested by running Kate's cmake scripts with the new macro with a single usage replaced by a target instead of a source list. Both the source lists usages and the target usage succeeded without errors and the resulting header was successfully added to the target's source list.

REPOSITORY
  R249 KI18n

REVISION DETAIL
  https://phabricator.kde.org/D22698

AFFECTED FILES
  cmake/KF5I18nMacros.cmake.in

To: daandemeyer
Cc: kde-frameworks-devel, LeGast00n, sbergeron, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190723/14cb8c9b/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list