D10450: Generate a custom target in kcoreaddons_desktop_to_json

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Sat Feb 17 21:27:21 UTC 2018


kossebau added a comment.


  In D10450#208413 <https://phabricator.kde.org/D10450#208413>, @mpyne wrote:
  
  > Yes, I think I agree with @rakuco.  Especially since the fix for D10485 <https://phabricator.kde.org/D10485> ended up being reverted.
  
  
  Would be happy if anyone on KDE neon could explore why it fails there (only reported for it so far AFAIK) so it had to be reverted. D10607 <https://phabricator.kde.org/D10607> meanwhile up as a less fragile-with-automoc variant.
  
  > I still think a separate fix is needed for kcm_lookandfeel, but the issue is that the `kcoreaddons_desktop_to_json` macro generates a JSON file which is intended for use in a compiled file, and there's no easy way to connect that dependency within *this* macro since the dependent source file is never actually passed into the macro.
  
  So just to make sure we are all on the same page: for what I have understood meanwhile is what is missing but needed here is a dependency rule between
  a) the generated JSON file (`kcm_lookandfeel.json`)
  b) the generated moc file (`kcm.moc`) created by moc for the source file which references that JSON file in the related QObject subclass declaration and also has the include statement (`kcm.cpp`)
  
  And this is what
  
    set_property(TARGET ${target} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${json})
  
  should ensure at least by what the docs claim IIUC, but somehow does not.
  
  > Alternately we could try to do what the kcoreaddons_add_plugin macro does and let the calling code pass in the sources to be made dependent upon the JSON.
  
  All the other source files should not have any influence here, only the cpp file referencing the JSON file.
  
  And adding
  
    add_dependencies(${target} ${_json_target})
  
  would also not ensure that straight dependency between the creation of the JSON file and the time when moc is run, no?

REPOSITORY
  R244 KCoreAddons

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

To: tcberner, #freebsd, mpyne, bshah, dfaure, rakuco
Cc: rikmills, rakuco, kfunk, adridg, kossebau, #frameworks, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180217/5ef2820e/attachment.html>


More information about the Kde-frameworks-devel mailing list