kcoreaddons_add_plugin: remove effectless OBJECT_DEPENDS on json file

The JSON file argument is passed to Q_PLUGIN_METADATA, which is a no-code
macro at the C++ level and only used to note information used by moc
for the generated moc file.

So when the content of the JSON file has changed, this will not change
anything in the preprocessed source file itself. It only has an effect on
the content of the moc file generated based on it, which is either included
and thus already triggers a dependecy or generated by automoc and compiled
separately into the target with the needed dependencies.

It is automoc which needs to properly trigger a recreation of the moc
file when checking the sources (and at least in 3.9 & 10 does),
and this is nothing that can be influenced by dependency rules.
This commit is contained in:
Friedrich W. H. Kossebau 2018-02-23 19:09:18 +01:00
parent aeabd92eea
commit 7aa5333a3f

View File

@ -15,7 +15,6 @@ function(kimageformats_add_plugin plugin)
message(FATAL_ERROR "JSON file doesn't exist: ${json}")
endif()
set_property(SOURCE ${KIF_ADD_PLUGIN_SOURCES} APPEND PROPERTY OBJECT_DEPENDS ${json})
add_library(${plugin} MODULE ${KIF_ADD_PLUGIN_SOURCES})
set_property(TARGET ${plugin} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${json})
set_target_properties(${plugin} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/imageformats")