diff options
author | Cristian Adam <cristian.adam@qt.io> | 2019-11-07 14:56:15 +0100 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2019-11-07 14:15:46 +0000 |
commit | eebf36adc776fde43acf69c1ff71bcf35836dbfd (patch) | |
tree | f3673eca6766f8cdb762accbbe24980f45daffb8 /cmake | |
parent | f930fb2b751683a9caefe1e7b8a76f03ff9af31a (diff) |
CMake: Make sure that explicit plugin.h files depend on the json file
ClangCodeModel plugin was not updating its version number because of
the EXPLICIT_MOC call.
Change-Id: I109d80c93d8af628c8981d49c93dcb0ebe21f1ee
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtCreatorAPI.cmake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index f32a8b24d5..41c9867bef 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -171,8 +171,12 @@ function(separate_object_libraries libraries REGULAR_LIBS OBJECT_LIBS OBJECT_LIB endfunction(separate_object_libraries) function(set_explicit_moc target_name file) + unset(file_dependencies) + if (file MATCHES "^.*plugin.h$") + set(file_dependencies DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${target_name}.json") + endif() set_property(SOURCE "${file}" PROPERTY SKIP_AUTOMOC ON) - qt5_wrap_cpp(file_moc "${file}") + qt5_wrap_cpp(file_moc "${file}" ${file_dependencies}) target_sources(${target_name} PRIVATE "${file_moc}") endfunction() |