summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2020-04-16 13:37:45 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2020-04-22 14:46:03 (GMT)
commit306a1ba96073175ddc0c4de4d5f17b44d432da33 (patch)
treee1d867f9aa6cc29ca178fbc8bde13fc92510d991 /Tests
parentad4487a96ae6e7e93e9b14d0fee67da01e27e12a (diff)
downloadCMake-306a1ba96073175ddc0c4de4d5f17b44d432da33.zip
CMake-306a1ba96073175ddc0c4de4d5f17b44d432da33.tar.gz
CMake-306a1ba96073175ddc0c4de4d5f17b44d432da33.tar.bz2
Modules/Documentation: remove
This is an old module from when VTK and other Kitware projects drove the addition of commands and modules into CMake itself. Modern VTK doesn't need this module and it can be ignored. This module is kept around so that the ancient VTK versions which use it are not broken by it. VTK itself stopped using the module in 2012 and the last usage by an example in VTK was removed in 2020. Fixes: #20591
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-Common.cmake10
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt9
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-NEW.cmake4
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-OLD.cmake9
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView-stderr.txt8
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView.cmake2
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-VTK-stderr.txt9
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-VTK.cmake2
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt37
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0106/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CMP0106/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/CMP0106/subdir/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
15 files changed, 110 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0106/CMP0106-Common.cmake b/Tests/RunCMake/CMP0106/CMP0106-Common.cmake
new file mode 100644
index 0000000..a1f7908
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-Common.cmake
@@ -0,0 +1,10 @@
+include(Documentation OPTIONAL RESULT_VARIABLE found)
+if (NOT should_find AND found)
+ message(FATAL_ERROR
+ "The Documentation module should not have been found, but it was.")
+endif ()
+if (should_find AND NOT found)
+ message(FATAL_ERROR
+ "The Documentation module should have been found, but it was not.")
+endif ()
+include(${CMAKE_ROOT}/Modules/Documentation.cmake)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-NEW-result.txt b/Tests/RunCMake/CMP0106/CMP0106-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt
new file mode 100644
index 0000000..7ad774e
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at .*/Modules/Documentation.cmake:15 \(message\):
+ Documentation.cmake is VTK-specific code and should not be used in non-VTK
+ projects. This logic in this module is best shipped with the project using
+ it rather than with CMake. This is now an error according to policy
+ CMP0106.
+Call Stack \(most recent call first\):
+ CMP0106-Common.cmake:10 \(include\)
+ CMP0106-NEW.cmake:4 \(include\)
+ CMakeLists.txt:7 \(include\)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-NEW.cmake b/Tests/RunCMake/CMP0106/CMP0106-NEW.cmake
new file mode 100644
index 0000000..e7d5bd1
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-NEW.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0106 NEW)
+
+set(should_find OFF)
+include(CMP0106-Common.cmake)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-OLD.cmake b/Tests/RunCMake/CMP0106/CMP0106-OLD.cmake
new file mode 100644
index 0000000..730e846
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-OLD.cmake
@@ -0,0 +1,9 @@
+cmake_policy(SET CMP0106 OLD)
+
+set(should_find ON)
+include(CMP0106-Common.cmake)
+if (NOT DEFINED BUILD_DOCUMENTATION)
+ message(FATAL_ERROR
+ "Cache variables seem to have not been made with a `OLD` policy "
+ "setting.")
+endif ()
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView-stderr.txt
new file mode 100644
index 0000000..b61889b
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView-stderr.txt
@@ -0,0 +1,8 @@
+CMake Warning \(dev\) at CMP0106-Common.cmake:1 \(include\):
+ Policy CMP0106 is not set: The Documentation module is removed. Run "cmake
+ --help-policy CMP0106" for policy details. Use the cmake_policy command to
+ set the policy and suppress this warning.
+
+Call Stack \(most recent call first\):
+ subdir/CMakeLists.txt:2 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView.cmake b/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView.cmake
new file mode 100644
index 0000000..309abcc
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView.cmake
@@ -0,0 +1,2 @@
+set(should_find ON)
+add_subdirectory(subdir)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK-stderr.txt
new file mode 100644
index 0000000..f8a754e
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK-stderr.txt
@@ -0,0 +1,9 @@
+CMake Warning \(dev\) at CMP0106-Common.cmake:1 \(include\):
+ Policy CMP0106 is not set: The Documentation module is removed. Run "cmake
+ --help-policy CMP0106" for policy details. Use the cmake_policy command to
+ set the policy and suppress this warning.
+
+Call Stack \(most recent call first\):
+ CMP0106-WARN-VTK.cmake:2 \(include\)
+ CMakeLists.txt:7 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK.cmake b/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK.cmake
new file mode 100644
index 0000000..99f6c39
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK.cmake
@@ -0,0 +1,2 @@
+set(should_find ON)
+include(CMP0106-Common.cmake)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt
new file mode 100644
index 0000000..d0d48d0
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt
@@ -0,0 +1,37 @@
+CMake Warning \(dev\) at CMP0106-Common.cmake:1 \(include\):
+ Policy CMP0106 is not set: The Documentation module is removed. Run "cmake
+ --help-policy CMP0106" for policy details. Use the cmake_policy command to
+ set the policy and suppress this warning.
+
+Call Stack \(most recent call first\):
+ CMP0106-WARN.cmake:2 \(include\)
+ CMakeLists.txt:7 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at .*/Modules/Documentation.cmake:27 \(message\):
+ Policy CMP0106 is not set: The Documentation module is removed. Run "cmake
+ --help-policy CMP0106" for policy details. Use the cmake_policy command to
+ set the policy and suppress this warning.
+
+ Documentation.cmake is VTK-specific code and should not be used in non-VTK
+ projects. This logic in this module is best shipped with the project using
+ it rather than with CMake.
+Call Stack \(most recent call first\):
+ CMP0106-Common.cmake:1 \(include\)
+ CMP0106-WARN.cmake:2 \(include\)
+ CMakeLists.txt:7 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at .*/Modules/Documentation.cmake:27 \(message\):
+ Policy CMP0106 is not set: The Documentation module is removed. Run "cmake
+ --help-policy CMP0106" for policy details. Use the cmake_policy command to
+ set the policy and suppress this warning.
+
+ Documentation.cmake is VTK-specific code and should not be used in non-VTK
+ projects. This logic in this module is best shipped with the project using
+ it rather than with CMake.
+Call Stack \(most recent call first\):
+ CMP0106-Common.cmake:10 \(include\)
+ CMP0106-WARN.cmake:2 \(include\)
+ CMakeLists.txt:7 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN.cmake b/Tests/RunCMake/CMP0106/CMP0106-WARN.cmake
new file mode 100644
index 0000000..99f6c39
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN.cmake
@@ -0,0 +1,2 @@
+set(should_find ON)
+include(CMP0106-Common.cmake)
diff --git a/Tests/RunCMake/CMP0106/CMakeLists.txt b/Tests/RunCMake/CMP0106/CMakeLists.txt
new file mode 100644
index 0000000..eafa642
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.1)
+if (RunCMake_TEST STREQUAL "CMP0106-WARN-VTK")
+ project(VTK NONE)
+else ()
+ project(${RunCMake_TEST} NONE)
+endif ()
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0106/RunCMakeTest.cmake b/Tests/RunCMake/CMP0106/RunCMakeTest.cmake
new file mode 100644
index 0000000..acec054
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/RunCMakeTest.cmake
@@ -0,0 +1,7 @@
+include(RunCMake)
+
+run_cmake(CMP0106-OLD)
+run_cmake(CMP0106-NEW)
+run_cmake(CMP0106-WARN)
+run_cmake(CMP0106-WARN-VTK)
+run_cmake(CMP0106-WARN-ParaView)
diff --git a/Tests/RunCMake/CMP0106/subdir/CMakeLists.txt b/Tests/RunCMake/CMP0106/subdir/CMakeLists.txt
new file mode 100644
index 0000000..ed1dd05
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/subdir/CMakeLists.txt
@@ -0,0 +1,2 @@
+project(VTK NONE)
+include(${CMAKE_CURRENT_SOURCE_DIR}/../CMP0106-Common.cmake)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index f5472d9..cc88868 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -119,6 +119,7 @@ add_RunCMake_test(CMP0102)
if(CMake_TEST_CUDA)
add_RunCMake_test(CMP0104)
endif()
+add_RunCMake_test(CMP0106)
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode