summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/NinjaMultiConfig
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-01-14 08:36:21 (GMT)
committerBrad King <brad.king@kitware.com>2020-01-28 16:16:11 (GMT)
commitf765fdea032b820f82789485172616c1456fb815 (patch)
tree07d332e7b821c01b107e66f8c2e48d8872ba0dbf /Tests/RunCMake/NinjaMultiConfig
parentf8c505d4b30aa636b013486913591060b2040716 (diff)
downloadCMake-f765fdea032b820f82789485172616c1456fb815.zip
CMake-f765fdea032b820f82789485172616c1456fb815.tar.gz
CMake-f765fdea032b820f82789485172616c1456fb815.tar.bz2
AutoGen: Use moc's feature to output dependencies
In Qt version 5.15.0 moc learned to output the dependencies of the generated file. This commit enhances JobCompileMocT to read the dependency file written by moc. The dependencies are stored in the same cache that's used for the dependencies determined by dependency filters. The dependency filter functionality is turned off if moc's dependency output feature is used. Fixes: #17750 Fixes: #19058
Diffstat (limited to 'Tests/RunCMake/NinjaMultiConfig')
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Qt5.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake b/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake
index 6a80b1d..dfc0f50 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake
@@ -11,8 +11,16 @@ target_link_libraries(exe PRIVATE Qt5::Core)
include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
generate_output_files(exe)
+set(moc_writes_depfiles 0)
+if(Qt5Core_VERSION VERSION_GREATER_EQUAL "5.15.0")
+ set(moc_writes_depfiles 1)
+endif()
+
set(autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/mocs_compilation.cpp")
foreach(c IN LISTS CMAKE_CONFIGURATION_TYPES)
list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${c}/moc_qt5.cpp")
+ if(moc_writes_depfiles)
+ list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${c}/moc_qt5.cpp.d")
+ endif()
endforeach()
file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(AUTOGEN_FILES [==[${autogen_files}]==])\n")