diff options
author | Brad King <brad.king@kitware.com> | 2023-03-09 12:39:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-09 12:39:36 (GMT) |
commit | 2c146a7fc5499669ea0aa8bf37fd4ef5c1c517e4 (patch) | |
tree | 516117e03933617ceee62b364631130cb6ca8d03 /Tests/RunCMake | |
parent | b6ffbffaf26006a361c1330d0edce9a6314f58bb (diff) | |
download | CMake-2c146a7fc5499669ea0aa8bf37fd4ef5c1c517e4.zip CMake-2c146a7fc5499669ea0aa8bf37fd4ef5c1c517e4.tar.gz CMake-2c146a7fc5499669ea0aa8bf37fd4ef5c1c517e4.tar.bz2 |
FindCUDA: Add policy to remove this module
The `FindCUDA` module has been deprecated since CMake 3.10.
Add a policy to pretend it doesn't exist in order to encourage
projects to port away from it.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/find_package/CMP0146-NEW-stderr.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/CMP0146-NEW.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/CMP0146-OLD.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/CMP0146-WARN-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/CMP0146-WARN.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/find_package/RunCMakeTest.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-NEW-name-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-NEW-name-stderr.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-NEW-name.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-NEW-path-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-NEW-path-stderr.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-NEW-path.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-OLD.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-WARN-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/include/CMP0146-WARN.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/include/RunCMakeTest.cmake | 5 |
16 files changed, 80 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_package/CMP0146-NEW-stderr.txt b/Tests/RunCMake/find_package/CMP0146-NEW-stderr.txt new file mode 100644 index 0000000..0162852 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0146-NEW-stderr.txt @@ -0,0 +1,4 @@ +^CMake Warning at CMP0146-NEW\.cmake:[0-9]+ \(find_package\): + No "FindCUDA\.cmake" found in CMAKE_MODULE_PATH\. +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/find_package/CMP0146-NEW.cmake b/Tests/RunCMake/find_package/CMP0146-NEW.cmake new file mode 100644 index 0000000..b373227 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0146-NEW.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0146 NEW) +set(_FindCUDA_testing TRUE) +find_package(CUDA MODULE) + +if(_FindCUDA_included) + message(FATAL_ERROR "FindCUDA.cmake erroneously included") +endif() diff --git a/Tests/RunCMake/find_package/CMP0146-OLD.cmake b/Tests/RunCMake/find_package/CMP0146-OLD.cmake new file mode 100644 index 0000000..77cd1f5 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0146-OLD.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0146 OLD) +set(_FindCUDA_testing TRUE) +find_package(CUDA MODULE) + +if(NOT _FindCUDA_included) + message(FATAL_ERROR "FindCUDA.cmake not included") +endif() diff --git a/Tests/RunCMake/find_package/CMP0146-WARN-stderr.txt b/Tests/RunCMake/find_package/CMP0146-WARN-stderr.txt new file mode 100644 index 0000000..2cd9c5f --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0146-WARN-stderr.txt @@ -0,0 +1,8 @@ +CMake Warning \(dev\) at CMP0146-WARN\.cmake:[0-9]+ \(find_package\): + Policy CMP0146 is not set: The FindCUDA module is removed\. Run "cmake + --help-policy CMP0146" 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\.$ diff --git a/Tests/RunCMake/find_package/CMP0146-WARN.cmake b/Tests/RunCMake/find_package/CMP0146-WARN.cmake new file mode 100644 index 0000000..276daf2 --- /dev/null +++ b/Tests/RunCMake/find_package/CMP0146-WARN.cmake @@ -0,0 +1,6 @@ +set(_FindCUDA_testing TRUE) +find_package(CUDA MODULE) + +if(NOT _FindCUDA_included) + message(FATAL_ERROR "FindCUDA.cmake not included") +endif() diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index f0bb011..924aa66 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -39,6 +39,9 @@ run_cmake(CMP0084-NEW) run_cmake(CMP0145-OLD) run_cmake(CMP0145-WARN) run_cmake(CMP0145-NEW) +run_cmake(CMP0146-OLD) +run_cmake(CMP0146-WARN) +run_cmake(CMP0146-NEW) run_cmake(WrongVersionRange) run_cmake(EmptyVersionRange) run_cmake(VersionRangeWithEXACT) diff --git a/Tests/RunCMake/include/CMP0146-NEW-name-result.txt b/Tests/RunCMake/include/CMP0146-NEW-name-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-NEW-name-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include/CMP0146-NEW-name-stderr.txt b/Tests/RunCMake/include/CMP0146-NEW-name-stderr.txt new file mode 100644 index 0000000..7d9e7d8 --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-NEW-name-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at CMP0146-NEW-name\.cmake:[0-9]+ \(include\): + include could not find requested file: + + FindCUDA +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/include/CMP0146-NEW-name.cmake b/Tests/RunCMake/include/CMP0146-NEW-name.cmake new file mode 100644 index 0000000..feedc6f --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-NEW-name.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0146 NEW) +include(FindCUDA) diff --git a/Tests/RunCMake/include/CMP0146-NEW-path-result.txt b/Tests/RunCMake/include/CMP0146-NEW-path-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-NEW-path-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include/CMP0146-NEW-path-stderr.txt b/Tests/RunCMake/include/CMP0146-NEW-path-stderr.txt new file mode 100644 index 0000000..916672b --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-NEW-path-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at [^ +]*/Modules/FindCUDA.cmake:[0-9]+ \(message\): + The FindCUDA module has been removed by policy CMP0146\. +Call Stack \(most recent call first\): + CMP0146-NEW-path\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/include/CMP0146-NEW-path.cmake b/Tests/RunCMake/include/CMP0146-NEW-path.cmake new file mode 100644 index 0000000..6768d4d --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-NEW-path.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0146 NEW) +include(${CMAKE_ROOT}/Modules/FindCUDA.cmake) diff --git a/Tests/RunCMake/include/CMP0146-OLD.cmake b/Tests/RunCMake/include/CMP0146-OLD.cmake new file mode 100644 index 0000000..654cdf7 --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-OLD.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0146 OLD) +set(_FindCUDA_testing 1) +include(FindCUDA) + +if(NOT _FindCUDA_included) + message(FATAL_ERROR "FindCUDA.cmake not included") +endif() diff --git a/Tests/RunCMake/include/CMP0146-WARN-stderr.txt b/Tests/RunCMake/include/CMP0146-WARN-stderr.txt new file mode 100644 index 0000000..aaaf1dc --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-WARN-stderr.txt @@ -0,0 +1,8 @@ +^CMake Warning \(dev\) at CMP0146-WARN\.cmake:[0-9]+ \(include\): + Policy CMP0146 is not set: The FindCUDA module is removed\. Run "cmake + --help-policy CMP0146" 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\.$ diff --git a/Tests/RunCMake/include/CMP0146-WARN.cmake b/Tests/RunCMake/include/CMP0146-WARN.cmake new file mode 100644 index 0000000..bce1ae8 --- /dev/null +++ b/Tests/RunCMake/include/CMP0146-WARN.cmake @@ -0,0 +1,7 @@ +# Do not set CMP0146. +set(_FindCUDA_testing 1) +include(FindCUDA) + +if(NOT _FindCUDA_included) + message(FATAL_ERROR "FindCUDA.cmake not included") +endif() diff --git a/Tests/RunCMake/include/RunCMakeTest.cmake b/Tests/RunCMake/include/RunCMakeTest.cmake index 8fb7201..b6fdb54 100644 --- a/Tests/RunCMake/include/RunCMakeTest.cmake +++ b/Tests/RunCMake/include/RunCMakeTest.cmake @@ -7,3 +7,8 @@ run_cmake(CMP0024-NEW) run_cmake(ExportExportInclude) run_cmake(IncludeIsDirectory) run_cmake(IncludeMalformed) + +run_cmake(CMP0146-OLD) +run_cmake(CMP0146-WARN) +run_cmake(CMP0146-NEW-name) +run_cmake(CMP0146-NEW-path) |