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.
This commit is contained in:
Brad King
2023-03-09 07:39:36 -05:00
parent b6ffbffaf2
commit 2c146a7fc5
23 changed files with 137 additions and 2 deletions

View File

@@ -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