CMake: Fix cimpilation error when CUDA dynload is disabled but toolkit is not installed
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Feb 2018 09:20:26 +0000 (10:20 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Feb 2018 09:20:26 +0000 (10:20 +0100)
CMakeLists.txt

index c0a0b4bd27f0132ea177614b85bf378c53cf37cd..f5b80efef8526fd4f3f92ce7d23b0fe4023a075e 100644 (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.