Skip to content

FindCUDA: Fix varaible reset with CUDA_TOOLKIT_TARGET_DIR

CUDA_TOOLKIT_TARGET_DIR doesn't always exist in the cache or defined by the user previous to using FindCUDA. In this case it will always reset the variables making it impossible to manually change or set them. This can be fixed by checking to see if the variable is defined before checking against the previously used version stored in CUDA_TOOLKIT_TARGET_DIR_INTERNAL.

Merge request reports