summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMP0169
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2024-05-25 08:59:01 (GMT)
committerCraig Scott <craig.scott@crascit.com>2024-05-29 08:52:24 (GMT)
commit4370fcf7505bf0dc651478ab581f19c474278c59 (patch)
treeb50809ab854330bfb7cb8012f4121c28ec7e5974 /Tests/RunCMake/CMP0169
parentbc70b458adb6204fc47a6f19c3216fcac86573ce (diff)
downloadCMake-4370fcf7505bf0dc651478ab581f19c474278c59.zip
CMake-4370fcf7505bf0dc651478ab581f19c474278c59.tar.gz
CMake-4370fcf7505bf0dc651478ab581f19c474278c59.tar.bz2
FetchContent: Deprecate FetchContent_Populate(depName)
Projects should use FetchContent_MakeAvailable(depName) instead. Policy CMP0169 provides backward compatibility.
Diffstat (limited to 'Tests/RunCMake/CMP0169')
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-NEW-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-NEW-stdout.txt2
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-NEW.cmake2
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-OLD-stdout.txt4
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-OLD.cmake2
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-WARN-stderr.txt11
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-WARN-stdout.txt4
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169-WARN.cmake1
-rw-r--r--Tests/RunCMake/CMP0169/CMP0169.cmake14
-rw-r--r--Tests/RunCMake/CMP0169/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0169/RunCMakeTest.cmake5
12 files changed, 59 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0169/CMP0169-NEW-result.txt b/Tests/RunCMake/CMP0169/CMP0169-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0169/CMP0169-NEW-stderr.txt b/Tests/RunCMake/CMP0169/CMP0169-NEW-stderr.txt
new file mode 100644
index 0000000..95418fb
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-NEW-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at .*/Modules/FetchContent\.cmake:[0-9]+ \(message\):
+ Calling FetchContent_Populate\(t2\) is deprecated, call
+ FetchContent_MakeAvailable\(t2\) instead\. Policy CMP0169 can be set to OLD
+ to allow FetchContent_Populate\(t2\) to be called directly for now, but the
+ ability to call it with declared details will be removed completely in a
+ future version\.
+Call Stack \(most recent call first\):
+ CMP0169\.cmake:[0-9]+ \(FetchContent_Populate\)
+ CMP0169-NEW\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0169/CMP0169-NEW-stdout.txt b/Tests/RunCMake/CMP0169/CMP0169-NEW-stdout.txt
new file mode 100644
index 0000000..b74fa26
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-NEW-stdout.txt
@@ -0,0 +1,2 @@
+Direct download
+-- Configuring incomplete, errors occurred!
diff --git a/Tests/RunCMake/CMP0169/CMP0169-NEW.cmake b/Tests/RunCMake/CMP0169/CMP0169-NEW.cmake
new file mode 100644
index 0000000..32328b6
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0169 NEW)
+include(CMP0169.cmake)
diff --git a/Tests/RunCMake/CMP0169/CMP0169-OLD-stdout.txt b/Tests/RunCMake/CMP0169/CMP0169-OLD-stdout.txt
new file mode 100644
index 0000000..ea56073
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-OLD-stdout.txt
@@ -0,0 +1,4 @@
+Direct download
+Declared download
+-- Configuring done \([0-9]+\.[0-9]s\)
+-- Generating done \([0-9]+\.[0-9]s\)
diff --git a/Tests/RunCMake/CMP0169/CMP0169-OLD.cmake b/Tests/RunCMake/CMP0169/CMP0169-OLD.cmake
new file mode 100644
index 0000000..217f137
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0169 OLD)
+include(CMP0169.cmake)
diff --git a/Tests/RunCMake/CMP0169/CMP0169-WARN-stderr.txt b/Tests/RunCMake/CMP0169/CMP0169-WARN-stderr.txt
new file mode 100644
index 0000000..7a06200
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-WARN-stderr.txt
@@ -0,0 +1,11 @@
+CMake Warning \(dev\) at .*/Modules/FetchContent\.cmake:[0-9]+ \(message\):
+ Calling FetchContent_Populate\(t2\) is deprecated, call
+ FetchContent_MakeAvailable\(t2\) instead\. Policy CMP0169 can be set to OLD
+ to allow FetchContent_Populate\(t2\) to be called directly for now, but the
+ ability to call it with declared details will be removed completely in a
+ future version\.
+Call Stack \(most recent call first\):
+ CMP0169\.cmake:[0-9]+ \(FetchContent_Populate\)
+ CMP0169-WARN\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/CMP0169/CMP0169-WARN-stdout.txt b/Tests/RunCMake/CMP0169/CMP0169-WARN-stdout.txt
new file mode 100644
index 0000000..ea56073
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-WARN-stdout.txt
@@ -0,0 +1,4 @@
+Direct download
+Declared download
+-- Configuring done \([0-9]+\.[0-9]s\)
+-- Generating done \([0-9]+\.[0-9]s\)
diff --git a/Tests/RunCMake/CMP0169/CMP0169-WARN.cmake b/Tests/RunCMake/CMP0169/CMP0169-WARN.cmake
new file mode 100644
index 0000000..63a9ecc
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169-WARN.cmake
@@ -0,0 +1 @@
+include(CMP0169.cmake)
diff --git a/Tests/RunCMake/CMP0169/CMP0169.cmake b/Tests/RunCMake/CMP0169/CMP0169.cmake
new file mode 100644
index 0000000..e7a900d
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMP0169.cmake
@@ -0,0 +1,14 @@
+cmake_policy(SET CMP0168 NEW) # Faster, don't need to test with sub-build
+
+include(FetchContent)
+
+FetchContent_Populate(t1
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Direct download"
+ UPDATE_COMMAND ""
+)
+
+FetchContent_Declare(t2
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Declared download"
+ UPDATE_COMMAND ""
+)
+FetchContent_Populate(t2)
diff --git a/Tests/RunCMake/CMP0169/CMakeLists.txt b/Tests/RunCMake/CMP0169/CMakeLists.txt
new file mode 100644
index 0000000..94e43ba
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.29)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0169/RunCMakeTest.cmake b/Tests/RunCMake/CMP0169/RunCMakeTest.cmake
new file mode 100644
index 0000000..92d7fcd
--- /dev/null
+++ b/Tests/RunCMake/CMP0169/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0169-WARN)
+run_cmake(CMP0169-OLD)
+run_cmake(CMP0169-NEW)