summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-15 13:33:47 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-07-15 13:33:47 (GMT)
commitfa6106ec56305b72017fff3d57836cc7319c8d48 (patch)
treed6ad7869059b65e9a1fae54aab96d2b5d630df20 /Tests/RunCMake
parentb6e0972262241b287fa4048b29dd920fecf22ea1 (diff)
parent484bb888a0c84805819749e7899333fc83794857 (diff)
downloadCMake-fa6106ec56305b72017fff3d57836cc7319c8d48.zip
CMake-fa6106ec56305b72017fff3d57836cc7319c8d48.tar.gz
CMake-fa6106ec56305b72017fff3d57836cc7319c8d48.tar.bz2
Merge topic 'target-policies'
484bb88 Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICY
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/TargetPolicies/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-result.txt1
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt13
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList.cmake8
-rw-r--r--Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/TargetPolicies/empty.cpp7
7 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 75e0e28..843af0e 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -97,6 +97,7 @@ add_RunCMake_test(list)
add_RunCMake_test(try_compile)
add_RunCMake_test(variable_watch)
add_RunCMake_test(CMP0004)
+add_RunCMake_test(TargetPolicies)
find_package(Qt4 QUIET)
find_package(Qt5Core QUIET)
diff --git a/Tests/RunCMake/TargetPolicies/CMakeLists.txt b/Tests/RunCMake/TargetPolicies/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-result.txt b/Tests/RunCMake/TargetPolicies/PolicyList-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
new file mode 100644
index 0000000..6533b75
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -0,0 +1,13 @@
+ Error evaluating generator expression:
+
+ \$<TARGET_POLICY:NOT_A_POLICY>
+
+ \$<TARGET_POLICY:prop> may only be used with a limited number of policies.
+ Currently it may be used with the following policies:
+
+ \* CMP0003
+ \* CMP0004
+ \* CMP0008
+ \* CMP0020
+ \* CMP0021
+ \* CMP0022
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList.cmake b/Tests/RunCMake/TargetPolicies/PolicyList.cmake
new file mode 100644
index 0000000..c290b65
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/PolicyList.cmake
@@ -0,0 +1,8 @@
+
+enable_language(CXX)
+
+add_library(empty empty.cpp)
+target_compile_definitions(empty
+ PRIVATE
+ $<$<TARGET_POLICY:NOT_A_POLICY>:SOME_DEFINE>
+)
diff --git a/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake b/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake
new file mode 100644
index 0000000..7a94630
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(PolicyList)
diff --git a/Tests/RunCMake/TargetPolicies/empty.cpp b/Tests/RunCMake/TargetPolicies/empty.cpp
new file mode 100644
index 0000000..7279c5e
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/empty.cpp
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int empty(void)
+{
+ return 0;
+}