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 /Modules/FindCUDA.cmake | |
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 'Modules/FindCUDA.cmake')
-rw-r--r-- | Modules/FindCUDA.cmake | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index c928157..c2ec82e 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -2,7 +2,12 @@ FindCUDA -------- -.. warning:: *Deprecated since version 3.10.* +.. versionchanged:: 3.27 + This module is available only if policy :policy:`CMP0146` is not set to ``NEW``. + Port projects to CMake's first-class ``CUDA`` language support. + +.. deprecated:: 3.10 + Do not use this module in new code. It is no longer necessary to use this module or call ``find_package(CUDA)`` for compiling CUDA code. Instead, list ``CUDA`` among the languages named @@ -555,6 +560,16 @@ The script defines the following variables: # ############################################################################### +cmake_policy(GET CMP0146 _FindCUDA_CMP0146) +if(_FindCUDA_CMP0146 STREQUAL "NEW") + message(FATAL_ERROR "The FindCUDA module has been removed by policy CMP0146.") +endif() + +if(_FindCUDA_testing) + set(_FindCUDA_included TRUE) + return() +endif() + # FindCUDA.cmake # This macro helps us find the location of helper files we will need the full path to |