diff options
author | Brad King <brad.king@kitware.com> | 2017-10-26 15:41:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-26 18:11:19 (GMT) |
commit | a2611d816b49bce8a85678455b6e80ed0f30fb3e (patch) | |
tree | f0ba92e9d7fc1905f62b302aa981e34943d4216a /Tests/RunCMake | |
parent | 103501c4e008a274aae1f25a3c2e2137b9e4c8e5 (diff) | |
download | CMake-a2611d816b49bce8a85678455b6e80ed0f30fb3e.zip CMake-a2611d816b49bce8a85678455b6e80ed0f30fb3e.tar.gz CMake-a2611d816b49bce8a85678455b6e80ed0f30fb3e.tar.bz2 |
Tests: Add RunCMake.CMP0037 case for WARN on reserved targets
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMP0037/CMP0037-WARN-reserved-stderr.txt | 36 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0037/CMP0037-WARN-reserved.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0037/RunCMakeTest.cmake | 1 |
3 files changed, 41 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved-stderr.txt new file mode 100644 index 0000000..2d556a7 --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved-stderr.txt @@ -0,0 +1,36 @@ +CMake Warning \(dev\) at CMP0037-WARN-reserved.cmake:2 \(add_library\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "all" is reserved or not valid for certain CMake features, + such as generator expressions, and may result in undefined behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at CMP0037-WARN-reserved.cmake:3 \(add_executable\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "clean" is reserved or not valid for certain CMake + features, such as generator expressions, and may result in undefined + behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at CMP0037-WARN-reserved.cmake:4 \(add_custom_target\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "help" is reserved or not valid for certain CMake features, + such as generator expressions, and may result in undefined behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved.cmake b/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved.cmake new file mode 100644 index 0000000..a5e0f10 --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-reserved.cmake @@ -0,0 +1,4 @@ +enable_language(CXX) +add_library(all empty.cpp) +add_executable(clean empty.cpp) +add_custom_target(help) diff --git a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake index b7d8d7b..04c1b52 100644 --- a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake @@ -9,5 +9,6 @@ if(NOT (WIN32 AND "${RunCMake_GENERATOR}" MATCHES "Make")) run_cmake(CMP0037-WARN-colon) endif() +run_cmake(CMP0037-WARN-reserved) run_cmake(CMP0037-OLD-reserved) run_cmake(CMP0037-NEW-reserved) |