diff options
author | Brad King <brad.king@kitware.com> | 2020-12-04 14:54:12 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2020-12-05 10:57:08 (GMT) |
commit | da7ad7997e383eda8532d91269130524158a0a86 (patch) | |
tree | 2579e0c76e5201f5904a8fd5a47ec75af96af98e /Tests | |
parent | 541f1410e06bc8c28876c6eb6dff594f6b046fc2 (diff) | |
download | CMake-da7ad7997e383eda8532d91269130524158a0a86.zip CMake-da7ad7997e383eda8532d91269130524158a0a86.tar.gz CMake-da7ad7997e383eda8532d91269130524158a0a86.tar.bz2 |
WriteCompilerDetectionHeader: Add policy to remove module
See justification in the policy documentation.
Closes: #17842
Diffstat (limited to 'Tests')
13 files changed, 60 insertions, 0 deletions
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-stderr.txt new file mode 100644 index 0000000..4e0d756 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at [^ +]*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + The WriteCompilerDetectionHeader module has been removed by policy CMP0120. +Call Stack \(most recent call first\): + CMP0120-NEW-Direct.cmake:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct.cmake new file mode 100644 index 0000000..4cd2c56 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0120 NEW) +include(${CMAKE_ROOT}/Modules/WriteCompilerDetectionHeader.cmake) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-stderr.txt new file mode 100644 index 0000000..2f7ad70 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at CMP0120-NEW.cmake:[0-9]+ \(include\): + include could not find requested file: + + WriteCompilerDetectionHeader +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW.cmake new file mode 100644 index 0000000..3d39a97 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0120 NEW) +include(WriteCompilerDetectionHeader) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct.cmake new file mode 100644 index 0000000..48517e6 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0120 OLD) +include(${CMAKE_ROOT}/Modules/WriteCompilerDetectionHeader.cmake) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD.cmake new file mode 100644 index 0000000..c513186 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0120 OLD) +include(WriteCompilerDetectionHeader) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct-stderr.txt new file mode 100644 index 0000000..88cd8f7 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct-stderr.txt @@ -0,0 +1,9 @@ +^CMake Warning \(dev\) at [^ +]*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + The WriteCompilerDetectionHeader module will be removed by policy CMP0120. + Projects should be ported away from the module, perhaps by bundling a copy + of the generated header or using a third-party alternative. +Call Stack \(most recent call first\): + CMP0120-WARN-Direct.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/WriteCompilerDetectionHeader/CMP0120-WARN-Direct.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct.cmake new file mode 100644 index 0000000..d3c7f77 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct.cmake @@ -0,0 +1,2 @@ + +include(${CMAKE_ROOT}/Modules/WriteCompilerDetectionHeader.cmake) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-stderr.txt new file mode 100644 index 0000000..315b4b1 --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-stderr.txt @@ -0,0 +1,18 @@ +^CMake Warning \(dev\) at CMP0120-WARN.cmake:[0-9]+ \(include\): + Policy CMP0120 is not set: The WriteCompilerDetectionHeader module is + removed. Run "cmake --help-policy CMP0120" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at [^ +]*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\): + The WriteCompilerDetectionHeader module will be removed by policy CMP0120. + Projects should be ported away from the module, perhaps by bundling a copy + of the generated header or using a third-party alternative. +Call Stack \(most recent call first\): + CMP0120-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/WriteCompilerDetectionHeader/CMP0120-WARN.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN.cmake new file mode 100644 index 0000000..1f95e3e --- /dev/null +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN.cmake @@ -0,0 +1,2 @@ + +include(WriteCompilerDetectionHeader) diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake index a834e6d..7589f74 100644 --- a/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake +++ b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake @@ -1,5 +1,12 @@ include(RunCMake) +run_cmake(CMP0120-WARN) +run_cmake(CMP0120-OLD) +run_cmake(CMP0120-NEW) +run_cmake(CMP0120-WARN-Direct) +run_cmake(CMP0120-OLD-Direct) +run_cmake(CMP0120-NEW-Direct) + run_cmake(InvalidArgs) run_cmake(NoCompiler) run_cmake(NoFeature) |