Merge "Fix CUDA being quiet and mark all CUDA_* as advanced" into release-4-6
authorChristoph Junghans <junghans@votca.org>
Fri, 11 Jan 2013 20:35:09 +0000 (21:35 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 11 Jan 2013 20:35:09 +0000 (21:35 +0100)
cmake/gmxManageGPU.cmake

index 2d0121555a1a26cba4dc94538b8398d4120dde87..2ad6661fedab67eac1f46c24152c1df237f97bea 100644 (file)
@@ -52,14 +52,14 @@ if(GMX_GPU_AUTO AND GMX_DOUBLE)
 endif()
 
 # detect GPUs in the build host machine
-if (GMX_GPU OR GMX_GPU_AUTO AND NOT GMX_GPU_DETECTION_DONE)
+if ((GMX_GPU OR GMX_GPU_AUTO) AND NOT GMX_GPU_DETECTION_DONE)
     include(gmxDetectGpu)
     gmx_detect_gpu()
 endif()
 
 # We need to call find_package even when we've already done the detection/setup
 if(GMX_GPU OR GMX_GPU_AUTO)
-    if(NOT GMX_GPU AND GMX_GPU_AUTO AND GMX_GPU_DETECTION_DONE)
+    if(NOT GMX_GPU AND NOT GMX_DETECT_GPU_AVAILABLE)
         # Stay quiet when detection has occured and found no GPU.
         # Noise is acceptable when there is a GPU or the user required one.
         set(FIND_CUDA_QUIETLY QUIET)
@@ -80,7 +80,7 @@ endif()
 # - ON , FALSE: The user requested GPU builds, will require CUDA and will fail
 #               if it is not available.
 # - ON , TRUE : Can't happen (GMX_GPU=ON can only be user-set at this point)
-if(GMX_GPU OR GMX_GPU_AUTO AND NOT GMX_GPU_DETECTION_DONE)
+if((GMX_GPU OR GMX_GPU_AUTO) AND NOT GMX_GPU_DETECTION_DONE)
     if (EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
         set(CUDA_FOUND TRUE CACHE INTERNAL "Whether the CUDA toolkit was found" FORCE)
     else()
@@ -142,6 +142,9 @@ endif()
 # user turns GMX_GPU=OFF after a failed cmake pass, these variables will be
 # left behind in the cache.
 mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_SDK_ROOT_DIR CUDA_VERBOSE_BUILD)
+if(NOT GMX_GPU)
+    mark_as_advanced(CUDA_TOOLKIT_ROOT_DIR)
+endif()
 
 macro(gmx_gpu_setup)
     # set up nvcc options