diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-02-11 16:41:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-02-12 16:17:38 (GMT) |
commit | c248a437c47b4419fd955d4b1f406f7c8b9dcd74 (patch) | |
tree | 37a953da5b8130fdde1e36e9c731930c161fd896 /Tests/RunCMake | |
parent | 418a155be7e44117297c072b6aa0f21f4407c052 (diff) | |
download | CMake-c248a437c47b4419fd955d4b1f406f7c8b9dcd74.zip CMake-c248a437c47b4419fd955d4b1f406f7c8b9dcd74.tar.gz CMake-c248a437c47b4419fd955d4b1f406f7c8b9dcd74.tar.bz2 |
Add policy CMP0049 to avoid variable expansion in source lists
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-NEW-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-NEW-stderr.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-NEW.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-OLD-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-OLD.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-WARN-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-WARN-stderr.txt | 11 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMP0049-WARN.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/RunCMakeTest.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0049/empty.cpp | 7 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 |
13 files changed, 50 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0049/CMP0049-NEW-result.txt b/Tests/RunCMake/CMP0049/CMP0049-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0049/CMP0049-NEW-stderr.txt b/Tests/RunCMake/CMP0049/CMP0049-NEW-stderr.txt new file mode 100644 index 0000000..ff787e8 --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-NEW-stderr.txt @@ -0,0 +1,6 @@ +CMake Error at CMP0049-NEW.cmake:5 \(add_library\): + Legacy variable expansion in source file "\${tgt_srcs}" expanded to + "empty.cpp" in target "tgt". This behavior will be removed in a future + version of CMake. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0049/CMP0049-NEW.cmake b/Tests/RunCMake/CMP0049/CMP0049-NEW.cmake new file mode 100644 index 0000000..85b5aa8 --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-NEW.cmake @@ -0,0 +1,5 @@ + +cmake_policy(SET CMP0049 NEW) + +set(tgt_srcs empty.cpp) +add_library(tgt \${tgt_srcs}) diff --git a/Tests/RunCMake/CMP0049/CMP0049-OLD-result.txt b/Tests/RunCMake/CMP0049/CMP0049-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt b/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0049/CMP0049-OLD.cmake b/Tests/RunCMake/CMP0049/CMP0049-OLD.cmake new file mode 100644 index 0000000..ae6fd3b --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-OLD.cmake @@ -0,0 +1,5 @@ + +cmake_policy(SET CMP0049 OLD) + +set(tgt_srcs empty.cpp) +add_library(tgt \${tgt_srcs}) diff --git a/Tests/RunCMake/CMP0049/CMP0049-WARN-result.txt b/Tests/RunCMake/CMP0049/CMP0049-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0049/CMP0049-WARN-stderr.txt b/Tests/RunCMake/CMP0049/CMP0049-WARN-stderr.txt new file mode 100644 index 0000000..0cf5ce3 --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-WARN-stderr.txt @@ -0,0 +1,11 @@ +CMake Warning \(dev\) at CMP0049-WARN.cmake:3 \(add_library\): + Policy CMP0049 is not set: Do not expand variables in target source + entries. Run "cmake --help-policy CMP0049" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Legacy variable expansion in source file "\${tgt_srcs}" expanded to + "empty.cpp" in target "tgt". This behavior will be removed in a future + version of CMake. +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/CMP0049/CMP0049-WARN.cmake b/Tests/RunCMake/CMP0049/CMP0049-WARN.cmake new file mode 100644 index 0000000..ada082e --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-WARN.cmake @@ -0,0 +1,3 @@ + +set(tgt_srcs empty.cpp) +add_library(tgt \${tgt_srcs}) diff --git a/Tests/RunCMake/CMP0049/CMakeLists.txt b/Tests/RunCMake/CMP0049/CMakeLists.txt new file mode 100644 index 0000000..2f10cb0 --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.12) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/CMP0049/RunCMakeTest.cmake b/Tests/RunCMake/CMP0049/RunCMakeTest.cmake new file mode 100644 index 0000000..a8aa9d9 --- /dev/null +++ b/Tests/RunCMake/CMP0049/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0049-OLD) +run_cmake(CMP0049-NEW) +run_cmake(CMP0049-WARN) diff --git a/Tests/RunCMake/CMP0049/empty.cpp b/Tests/RunCMake/CMP0049/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CMP0049/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index c29b736..ef6f69d 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -32,6 +32,7 @@ endif() add_RunCMake_test(CMP0043) add_RunCMake_test(CMP0045) add_RunCMake_test(CMP0046) +add_RunCMake_test(CMP0049) add_RunCMake_test(CTest) if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") add_RunCMake_test(CompilerChange) |