don't warn during configuring if no GPUs were found
[alexxy/gromacs.git] / CMakeLists.txt
index bd215f959014f28786f68983ef2c289dde5b62db..3cdc44e8c44c15f135be32202b91c07b26126a7e 100644 (file)
@@ -1163,9 +1163,9 @@ add_subdirectory(include)
 add_subdirectory(src)
 add_subdirectory(scripts)
 
-# issue GPU acceleration/CUDA-related warning or error if GMX_GPU was set
-# Auto and NVIDIA GPUs were detected.
-if (CUDA_NOTFOUND_AUTO AND NOT GMX_GPU_DETECTION_DONE)
+# Issue a warning if NVIDIA GPUs were detected, but CUDA was not found.
+# Don't bother the user after the first configure pass.
+if ((CUDA_NOTFOUND_AUTO AND GMX_DETECT_GPU_AVAILABLE) AND NOT GMX_GPU_DETECTION_DONE)
     message(WARNING "${CUDA_NOTFOUND_MESSAGE}")
     unset(CUDA_NOTFOUND_AUTO)
     unset(CUDA_NOTFOUND_MESSAGE)