diff options
author | Brad King <brad.king@kitware.com> | 2021-02-24 14:44:54 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-02-24 14:44:59 (GMT) |
commit | 261ba006682a064177fc1d9beee9c5ec0f3ea378 (patch) | |
tree | 93e89b2ea2ff5c11ac467dd52e9d4cc5fefbd473 /Tests | |
parent | 9569b3f43755e03d4f5d618a8c37005bb761816a (diff) | |
parent | 339dbc901f04369e997d8d65b60380d6255e5f10 (diff) | |
download | CMake-261ba006682a064177fc1d9beee9c5ec0f3ea378.zip CMake-261ba006682a064177fc1d9beee9c5ec0f3ea378.tar.gz CMake-261ba006682a064177fc1d9beee9c5ec0f3ea378.tar.bz2 |
Merge topic 'autogen-cmp0116-fix' into release-3.20
339dbc901f Help: Note that CMP0116 is recorded at the time of CC creation
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN
cf34011ce7 Tests: Test per-CC behavior of CMP0116
3a95503512 Ninja: Use CMP0116 status recorded at time of custom command's creation
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5848
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt | 17 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake | 18 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0116/RunCMakeTest.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/QtSubDir3/CMakeLists.txt | 2 |
5 files changed, 41 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt new file mode 100644 index 0000000..10e83a9 --- /dev/null +++ b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt @@ -0,0 +1,17 @@ +^CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\): + Policy CMP0116 is not set: Ninja generators transform DEPFILEs from + add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy + details\. Use the cmake_policy command to set the policy and suppress this + warning\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.( + +CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\): + Policy CMP0116 is not set: Ninja generators transform DEPFILEs from + add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy + details\. Use the cmake_policy command to set the policy and suppress this + warning\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.)*$ diff --git a/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake b/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake new file mode 100644 index 0000000..6cbbc09 --- /dev/null +++ b/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake @@ -0,0 +1,18 @@ +add_custom_command( + OUTPUT warn.txt + COMMAND ${CMAKE_COMMAND} -E touch warn.txt + DEPFILE warn.d + ) +cmake_policy(SET CMP0116 OLD) +add_custom_command( + OUTPUT old.txt + COMMAND ${CMAKE_COMMAND} -E touch old.txt + DEPFILE old.d + ) +cmake_policy(SET CMP0116 NEW) +add_custom_command( + OUTPUT new.txt + COMMAND ${CMAKE_COMMAND} -E touch new.txt + DEPFILE new.d + ) +add_custom_target(cc ALL DEPENDS warn.txt old.txt new.txt) diff --git a/Tests/RunCMake/CMP0116/RunCMakeTest.cmake b/Tests/RunCMake/CMP0116/RunCMakeTest.cmake index 8a83cc1..ce3e86a 100644 --- a/Tests/RunCMake/CMP0116/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0116/RunCMakeTest.cmake @@ -47,3 +47,6 @@ run_cmp0116(NEW OFF) run_cmp0116(WARN ON) run_cmp0116(OLD ON) run_cmp0116(NEW ON) + +set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_WARNING_CMP0116:BOOL=TRUE) +run_cmake(CMP0116-Mixed) diff --git a/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake b/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake index d314ff3..7456608 100644 --- a/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake +++ b/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake @@ -10,3 +10,4 @@ target_link_libraries(app_with_qt PRIVATE simple_lib Qt5::Core) add_subdirectory(QtSubDir1) add_subdirectory(QtSubDir2) +add_subdirectory(QtSubDir3) diff --git a/Tests/RunCMake/Ninja/QtSubDir3/CMakeLists.txt b/Tests/RunCMake/Ninja/QtSubDir3/CMakeLists.txt new file mode 100644 index 0000000..d38cfe0 --- /dev/null +++ b/Tests/RunCMake/Ninja/QtSubDir3/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(sub_exe_3 ../app.cpp) +target_link_libraries(sub_exe_3 PRIVATE Qt5::Core) |