CMake: Fix cimpilation error when CUDA dynload is disabled but toolkit is not installed

This commit is contained in:
Sergey Sharybin 2018-02-14 10:20:26 +01:00
parent b48815a9b7
commit c341dd0585
1 changed files with 9 additions and 0 deletions

View File

@ -744,6 +744,15 @@ if(WITH_AUDASPACE)
endif()
endif()
# Auto-enable CUDA dynload if toolkit is not found.
if(NOT WITH_CUDA_DYNLOAD)
find_package(CUDA)
if (NOT CUDA_FOUND)
message("CUDA toolkit not found, using dynamic runtime loading of libraries instead")
set(WITH_CUDA_DYNLOAD ON)
endif()
endif()
#-----------------------------------------------------------------------------
# Check for valid directories
# ... a partial checkout may cause this.