<table><tr><td style="">mpyne added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D10450" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Yes, I think I agree with <a href="https://phabricator.kde.org/p/rakuco/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;" rel="noreferrer">@rakuco</a>.  Especially since the fix for <a href="https://phabricator.kde.org/D10485" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: line-through;" rel="noreferrer">D10485</a> ended up being reverted.  I still think a separate fix is needed for kcm_lookandfeel, but the issue is that the <tt style="background: #ebebeb; font-size: 13px;">kcoreaddons_desktop_to_json</tt> 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.</p>

<p>I do think it makes more sense to have the custom command here be a custom target but that wouldn't help fix the dependency link-up.</p>

<p>Would it be possible in CMake to alter the macro to somehow make the JSON a dependency of *all* the source files of the provided target instead of just the auto-generated files?  That would seem to get the right ordering without too much fuss.  <tt style="background: #ebebeb; font-size: 13px;">add_custom_command</tt> has a second signature that looks useful (offers to make the command happen in "PRE BUILD", however it only works for MSVC.</p>

<p>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.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R244 KCoreAddons</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10450" rel="noreferrer">https://phabricator.kde.org/D10450</a></div></div><br /><div><strong>To: </strong>tcberner, FreeBSD, mpyne, bshah, dfaure, rakuco<br /><strong>Cc: </strong>rikmills, rakuco, kfunk, adridg, kossebau, Frameworks, michaelh<br /></div>