summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-12-09 14:13:53 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-12-09 14:14:00 (GMT)
commitacc9c89914ca184d107efd8a84282553c271de60 (patch)
tree3f82138ae828c232140d3e4004ade81b66b0d643 /Tests
parentd5b12ddcbca4d0919056c7815a9335087e9f2638 (diff)
parent10809357322789889670d5829bb96fcc545870af (diff)
downloadCMake-acc9c89914ca184d107efd8a84282553c271de60.zip
CMake-acc9c89914ca184d107efd8a84282553c271de60.tar.gz
CMake-acc9c89914ca184d107efd8a84282553c271de60.tar.bz2
Merge topic 'cmp0116-automoc'
1080935732 AutoGen: Account for CMP0116 in the depfile 287c591079 cmake -E: Fix cmake_transform_depfile escaping of transformed paths Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !5584
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake3
-rw-r--r--Tests/RunCMake/Ninja/QtSubDir1/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/Ninja/QtSubDir2/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake13
4 files changed, 22 insertions, 2 deletions
diff --git a/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake b/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake
index d69a119..d314ff3 100644
--- a/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake
+++ b/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake
@@ -7,3 +7,6 @@ set(CMAKE_AUTOMOC ON)
add_library(simple_lib SHARED simple_lib.cpp)
add_executable(app_with_qt app.cpp app_qt.cpp)
target_link_libraries(app_with_qt PRIVATE simple_lib Qt5::Core)
+
+add_subdirectory(QtSubDir1)
+add_subdirectory(QtSubDir2)
diff --git a/Tests/RunCMake/Ninja/QtSubDir1/CMakeLists.txt b/Tests/RunCMake/Ninja/QtSubDir1/CMakeLists.txt
new file mode 100644
index 0000000..64016b6
--- /dev/null
+++ b/Tests/RunCMake/Ninja/QtSubDir1/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0116 OLD)
+
+add_executable(sub_exe_1 ../app.cpp)
+target_link_libraries(sub_exe_1 PRIVATE Qt5::Core)
diff --git a/Tests/RunCMake/Ninja/QtSubDir2/CMakeLists.txt b/Tests/RunCMake/Ninja/QtSubDir2/CMakeLists.txt
new file mode 100644
index 0000000..3176426
--- /dev/null
+++ b/Tests/RunCMake/Ninja/QtSubDir2/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0116 NEW)
+
+add_executable(sub_exe_2 ../app.cpp)
+target_link_libraries(sub_exe_2 PRIVATE Qt5::Core)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index e6f86a1..b91ab00 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -338,8 +338,17 @@ function(run_Qt5AutoMocDeps)
# 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}")
+ message(FATAL_ERROR
+ "AUTOMOC should not have executed for 'app_with_qt' target:\nstdout:\n${ninja_stdout}")
+ endif()
+ # Assert that the subdir executables were not rebuilt.
+ if(ninja_stdout MATCHES "Automatic MOC for target sub_exe_1")
+ message(FATAL_ERROR
+ "AUTOMOC should not have executed for 'sub_exe_1' target:\nstdout:\n${ninja_stdout}")
+ endif()
+ if(ninja_stdout MATCHES "Automatic MOC for target sub_exe_2")
+ message(FATAL_ERROR
+ "AUTOMOC should not have executed for 'sub_exe_2' target:\nstdout:\n${ninja_stdout}")
endif()
endif()
endfunction()