summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Ninja/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-08-05 19:42:39 (GMT)
committerBrad King <brad.king@kitware.com>2020-08-05 19:42:39 (GMT)
commit9a9ed4b9d3f9658fa0615bb3cef601c5d396bf3b (patch)
treea250ea9bb63378aa00b46916ecdf04b47dba2e53 /Tests/RunCMake/Ninja/RunCMakeTest.cmake
parent63a65baf4c343c73b2142078ef0045d3711dea1d (diff)
parent7445c9a58a2444c8918e81a9264b1584001ca013 (diff)
downloadCMake-9a9ed4b9d3f9658fa0615bb3cef601c5d396bf3b.zip
CMake-9a9ed4b9d3f9658fa0615bb3cef601c5d396bf3b.tar.gz
CMake-9a9ed4b9d3f9658fa0615bb3cef601c5d396bf3b.tar.bz2
Merge branch 'backport-3.17-automoc_timestamp_deps'
Diffstat (limited to 'Tests/RunCMake/Ninja/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake21
1 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 8f9c263..d43023b 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -138,6 +138,7 @@ ${ninja_stderr}
message(FATAL_ERROR
"top ninja build failed exited with status ${ninja_result}")
endif()
+ set(ninja_stdout "${ninja_stdout}" PARENT_SCOPE)
endfunction(run_ninja)
function (run_LooseObjectDepends)
@@ -322,3 +323,23 @@ function (run_ChangeBuildType)
run_ninja("${RunCMake_TEST_BINARY_DIR}" -w dupbuild=err)
endfunction()
run_ChangeBuildType()
+
+function(run_Qt5AutoMocDeps)
+ if(CMake_TEST_Qt5 AND CMAKE_TEST_Qt5Core_Version VERSION_GREATER_EQUAL 5.15.0)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Qt5AutoMocDeps-build)
+ run_cmake(Qt5AutoMocDeps)
+ unset(RunCMake_TEST_OPTIONS)
+ # Build the project.
+ run_ninja("${RunCMake_TEST_BINARY_DIR}")
+ # Touch just the library source file, which shouldn't cause a rerun of AUTOMOC
+ # for app_with_qt target.
+ touch("${RunCMake_SOURCE_DIR}/simple_lib.cpp")
+ # Build and assert that AUTOMOC was not run for app_with_qt.
+ run_ninja("${RunCMake_TEST_BINARY_DIR}")
+ if(ninja_stdout MATCHES "Automatic MOC for target app_with_qt")
+ message(FATAL_ERROR
+ "AUTOMOC should not have executed for 'app_with_qt' target:\nstdout:\n${ninja_stdout}")
+ endif()
+ endif()
+endfunction()
+run_Qt5AutoMocDeps()