summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0126/CMP0126-OLD.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CMP0126/CMP0126-OLD.cmake')
-rw-r--r--Tests/RunCMake/CMP0126/CMP0126-OLD.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0126/CMP0126-OLD.cmake b/Tests/RunCMake/CMP0126/CMP0126-OLD.cmake
new file mode 100644
index 0000000..22a5037
--- /dev/null
+++ b/Tests/RunCMake/CMP0126/CMP0126-OLD.cmake
@@ -0,0 +1,25 @@
+
+# enforce policy CMP0125 to ensure predictable result of find_* commands
+cmake_policy(SET CMP0125 NEW)
+
+cmake_policy(SET CMP0126 OLD)
+
+set(VAR 1)
+set(VAR 2 CACHE STRING "")
+
+if (VAR EQUAL 1)
+ message(FATAL_ERROR "normal variable still exist.")
+endif()
+
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/file.txt" "")
+set(VAR file.txt)
+set(VAR "" CACHE STRING "" FORCE)
+set_property(CACHE VAR PROPERTY TYPE UNINITIALIZED)
+
+find_file(VAR NAMES file.txt PATHS "${CMAKE_CURRENT_BINARY_DIR}")
+
+unset(VAR CACHE)
+if (DEFINED VAR)
+ message(FATAL_ERROR "find_file: normal variable still exist.")
+endif()