summaryrefslogtreecommitdiff
path: root/Modules/FindCUDA.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-09 07:39:36 -0500
committerBrad King <brad.king@kitware.com>2023-03-09 07:39:36 -0500
commit2c146a7fc5499669ea0aa8bf37fd4ef5c1c517e4 (patch)
tree516117e03933617ceee62b364631130cb6ca8d03 /Modules/FindCUDA.cmake
parentb6ffbffaf26006a361c1330d0edce9a6314f58bb (diff)
downloadcmake-2c146a7fc5499669ea0aa8bf37fd4ef5c1c517e4.tar.gz
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.cmake17
1 files changed, 16 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index c9281574ba..c2ec82eb5a 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