D10450: Generate a custom target in kcoreaddons_desktop_to_json

Michael Pyne noreply at phabricator.kde.org
Sat Feb 17 22:12:32 UTC 2018


mpyne added a comment.


  In D10450#208453 <https://phabricator.kde.org/D10450#208453>, @kossebau wrote:
  
  > 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.
  
  
  OK, I see what you're talking about.
  
  > 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?
  
  No, you're right, it would only ensure that automoc and JSON creation both happen before the rest of the normal target build occurs.
  
  The custom target has a separate annoyance, using `add_custom_target` instead of `add_custom_command` makes it so that the entire JSON generation process seems to happen each time make or ninja is run, rather than only when needed from the dependencies changing, though I think this is due to the `add_dependencies` call rather than any issue specific to the CMake target itself.
  
  This isn't just a problem on KDE Neon though, is it?  I thought FreeBSD is also affected?

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/fe7661dd/attachment.html>


More information about the Kde-frameworks-devel mailing list