summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0135
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CMP0135')
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-Common.cmake18
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt1
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-NEW.cmake2
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt1
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-OLD.cmake2
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt1
-rw-r--r--Tests/RunCMake/CMP0135/CMP0135-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0135/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0135/RunCMakeTest.cmake5
10 files changed, 45 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0135/CMP0135-Common.cmake b/Tests/RunCMake/CMP0135/CMP0135-Common.cmake
new file mode 100644
index 0000000..4b7cce5
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-Common.cmake
@@ -0,0 +1,18 @@
+include(ExternalProject)
+
+set(stamp_dir "${CMAKE_CURRENT_BINARY_DIR}/stamps")
+
+ExternalProject_Add(fake_ext_proj
+ # We don't actually do a build, so we never try to download from this URL
+ URL https://example.com/something.zip
+ STAMP_DIR ${stamp_dir}
+)
+
+# Report whether the --touch option was added to the extraction script
+set(extraction_script "${stamp_dir}/extract-fake_ext_proj.cmake")
+file(STRINGS "${extraction_script}" results REGEX "--touch")
+if("${results}" STREQUAL "")
+ message(STATUS "Using timestamps from archive")
+else()
+ message(STATUS "Using extraction time for the timestamps")
+endif()
diff --git a/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt
new file mode 100644
index 0000000..bf53c0b
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-NEW-stdout.txt
@@ -0,0 +1 @@
+Using extraction time for the timestamps
diff --git a/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake b/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake
new file mode 100644
index 0000000..1fd6354
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0135 NEW)
+include(CMP0135-Common.cmake)
diff --git a/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt
new file mode 100644
index 0000000..ee57beb
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-OLD-stdout.txt
@@ -0,0 +1 @@
+Using timestamps from archive
diff --git a/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake b/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake
new file mode 100644
index 0000000..80d58a7
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0135 OLD)
+include(CMP0135-Common.cmake)
diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt b/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt
new file mode 100644
index 0000000..8ba0027
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-WARN-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
+ The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
+ not set\. The policy's OLD behavior will be used\. When using a URL
+ download, the timestamps of extracted files should preferably be that of
+ the time of extraction, otherwise code that depends on the extracted
+ contents might not be rebuilt if the URL changes\. The OLD behavior
+ preserves the timestamps from the archive instead, but this is usually not
+ what you want\. Update your project to the NEW behavior or specify the
+ DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
+ robustness issue\.
diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt b/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt
new file mode 100644
index 0000000..ee57beb
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-WARN-stdout.txt
@@ -0,0 +1 @@
+Using timestamps from archive
diff --git a/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake b/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake
new file mode 100644
index 0000000..ab71c40
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMP0135-WARN.cmake
@@ -0,0 +1,2 @@
+
+include(CMP0135-Common.cmake)
diff --git a/Tests/RunCMake/CMP0135/CMakeLists.txt b/Tests/RunCMake/CMP0135/CMakeLists.txt
new file mode 100644
index 0000000..5ff8d3e
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.23)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0135/RunCMakeTest.cmake b/Tests/RunCMake/CMP0135/RunCMakeTest.cmake
new file mode 100644
index 0000000..da92391
--- /dev/null
+++ b/Tests/RunCMake/CMP0135/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0135-WARN)
+run_cmake(CMP0135-OLD)
+run_cmake(CMP0135-NEW)