summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-01-08 12:16:33 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-01-08 15:41:34 (GMT)
commit73e93400e2efab2096618ff58a5ad68236cd04aa (patch)
treebc144c3cd832a7afa9aab8d598ca82f6ac77da9e /Tests/RunCMake
parentab9f58f657a244d182ccd9a9361fae0a7c068f20 (diff)
downloadCMake-73e93400e2efab2096618ff58a5ad68236cd04aa.zip
CMake-73e93400e2efab2096618ff58a5ad68236cd04aa.tar.gz
CMake-73e93400e2efab2096618ff58a5ad68236cd04aa.tar.bz2
get_target_property: Error on non-existent target.
Introduce policy CMP0045 to control this behavior.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt4
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-NEW.cmake4
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-OLD.cmake4
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt9
-rw-r--r--Tests/RunCMake/CMP0045/CMP0045-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0045/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0045/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMP0045/empty.cpp7
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
13 files changed, 43 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0045/CMP0045-NEW-result.txt b/Tests/RunCMake/CMP0045/CMP0045-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt
new file mode 100644
index 0000000..805a85e
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-NEW-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at CMP0045-NEW.cmake:4 \(get_target_property\):
+ get_target_property\(\) called with non-existent target "tgt".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake b/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake
new file mode 100644
index 0000000..7b2a3cd
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0045 NEW)
+
+get_target_property(result tgt TYPE)
diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt b/Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake b/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake
new file mode 100644
index 0000000..90201a3
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0045 OLD)
+
+get_target_property(result tgt TYPE)
diff --git a/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt b/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-WARN-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt
new file mode 100644
index 0000000..4c53224
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-WARN-stderr.txt
@@ -0,0 +1,9 @@
+CMake Warning \(dev\) at CMP0045-WARN.cmake:2 \(get_target_property\):
+ Policy CMP0045 is not set: Error on non-existent target in
+ get_target_property. Run "cmake --help-policy CMP0045" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ get_target_property\(\) called with non-existent target "tgt".
+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/CMP0045/CMP0045-WARN.cmake b/Tests/RunCMake/CMP0045/CMP0045-WARN.cmake
new file mode 100644
index 0000000..86a99a0
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMP0045-WARN.cmake
@@ -0,0 +1,2 @@
+
+get_target_property(result tgt TYPE)
diff --git a/Tests/RunCMake/CMP0045/CMakeLists.txt b/Tests/RunCMake/CMP0045/CMakeLists.txt
new file mode 100644
index 0000000..11ea636
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/CMP0045/RunCMakeTest.cmake b/Tests/RunCMake/CMP0045/RunCMakeTest.cmake
new file mode 100644
index 0000000..7c0e8a2
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0045-OLD)
+run_cmake(CMP0045-NEW)
+run_cmake(CMP0045-WARN)
diff --git a/Tests/RunCMake/CMP0045/empty.cpp b/Tests/RunCMake/CMP0045/empty.cpp
new file mode 100644
index 0000000..bfbbdde
--- /dev/null
+++ b/Tests/RunCMake/CMP0045/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 01ab5d4..944b898 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -65,6 +65,7 @@ if(CMAKE_SYSTEM_NAME MATCHES Darwin AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG)
add_RunCMake_test(CMP0042)
endif()
add_RunCMake_test(CMP0043)
+add_RunCMake_test(CMP0045)
add_RunCMake_test(CTest)
if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
add_RunCMake_test(CompilerChange)