<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><blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D10450#208453" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">D10450#208453</a>, <a href="https://phabricator.kde.org/p/kossebau/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;" rel="noreferrer">@kossebau</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><p>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<br />
a) the generated JSON file (<tt style="background: #ebebeb; font-size: 13px;">kcm_lookandfeel.json</tt>)<br />
b) the generated moc file (<tt style="background: #ebebeb; font-size: 13px;">kcm.moc</tt>) created by moc for the source file which references that JSON file in the related QObject subclass declaration and also has the include statement (<tt style="background: #ebebeb; font-size: 13px;">kcm.cpp</tt>)</p>
<p>And this is what</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">set_property(TARGET ${target} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${json})</pre></div>
<p>should ensure at least by what the docs claim IIUC, but somehow does not.</p></div>
</blockquote>
<p>OK, I see what you're talking about.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>And adding</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">add_dependencies(${target} ${_json_target})</pre></div>
<p>would also not ensure that straight dependency between the creation of the JSON file and the time when moc is run, no?</p></blockquote>
<p>No, you're right, it would only ensure that automoc and JSON creation both happen before the rest of the normal target build occurs.</p>
<p>The custom target has a separate annoyance, using <tt style="background: #ebebeb; font-size: 13px;">add_custom_target</tt> instead of <tt style="background: #ebebeb; font-size: 13px;">add_custom_command</tt> 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 <tt style="background: #ebebeb; font-size: 13px;">add_dependencies</tt> call rather than any issue specific to the CMake target itself.</p>
<p>This isn't just a problem on KDE Neon though, is it? I thought FreeBSD is also affected?</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>