<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>What about this?  I can't change the diff since I didn't create the RR, but this seems to cause the required dependency rules to be added and works for me to build plasma-desktop.  The only real addition is the <tt style="background: #ebebeb; font-size: 13px;">add_dependencies</tt> call.  I tried this without the <tt style="background: #ebebeb; font-size: 13px;">add_custom_target</tt> dance but CMake complained about the JSON file not being present so it looks like it needs to be a real CMake target to work.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="diff" 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);"><span style="color: #000080">diff --git a/KF5CoreAddonsMacros.cmake b/KF5CoreAddonsMacros.cmake</span>
<span style="color: #000080">index f22817d..c15ab98 100644</span>
<span style="color: #a00000">--- a/KF5CoreAddonsMacros.cmake</span>
<span style="color: #00a000">+++ b/KF5CoreAddonsMacros.cmake</span>
<span style="color: #800080">@@ -58,13 +58,19 @@ function(kcoreaddons_desktop_to_json target desktop)</span>
       endforeach()
     endif()
 
<span style="color: #00a000">+    # Create a virtual target for the generated JSON file and force</span>
<span style="color: #00a000">+    # the passed in target and its auto-generated sources to depend upon it</span>
<span style="color: #00a000">+    string(RANDOM _target_name_suffix)</span>
<span style="color: #00a000">+    set(_json_target "desktop_to_json_${_target_name_suffix}")</span>
<span style="color: #00a000">+    add_custom_target(${_json_target})</span>
     add_custom_command(
<span style="color: #a00000">-        OUTPUT ${json}</span>
<span style="color: #00a000">+        TARGET ${_json_target}</span>
         COMMAND ${command}
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
         DEPENDS ${desktop}
     )
<span style="color: #a00000">-    set_property(TARGET ${target} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${json})</span>
<span style="color: #00a000">+    add_dependencies(${target} ${_json_target})</span>
<span style="color: #00a000">+    set_property(TARGET ${target} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${_json_target})</span>
 endfunction()
 
 function(_desktop_to_json_cmake28 desktop json compat)</pre></div>

<p>A resulting Make-based build directory seems to contain the right rules:</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);">CMakeFiles/Makefile2
6522:kcms/lookandfeel/CMakeFiles/kcm_lookandfeel.dir/all: kcms/lookandfeel/CMakeFiles/desktop_to_json_ChFVC.dir/all
6597:kcms/lookandfeel/CMakeFiles/kcm_lookandfeel_autogen.dir/all: kcms/lookandfeel/CMakeFiles/desktop_to_json_ChFVC.dir/all</pre></div></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>