diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-14 12:20:26 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-14 12:20:26 +0300 |
commit | c341dd0585b73a0526573c085e6d265b0daf6738 (patch) | |
tree | d5ded6a535330d73d0f1f7f4414fb40b49e14ec7 /CMakeLists.txt | |
parent | b48815a9b75708d158cf7931357904ac8f6b189a (diff) |
CMake: Fix cimpilation error when CUDA dynload is disabled but toolkit is not installed
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c0a0b4bd27f..f5b80efef85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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. |