diff --git a/CMakeLists.txt b/CMakeLists.txt index ceac20e5f38..bfa52336ede 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -667,7 +667,7 @@ endif() include(cmake/Dependencies.cmake) -if((CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 10.2) AND (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")) +if(USE_CUDA AND (CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 10.2) AND (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")) # CUDA < 10.2 doesn't support compiling and extracting header dependencies in # one call, so instead CMake calls nvcc twice with && in between. # However, on windows cmd.exe has a 8191 character limit for commands which we