always mark as advanced leftover FindCUDA variables
authorSzilard Pall <pszilard@cbr.su.se>
Thu, 15 Nov 2012 22:26:47 +0000 (23:26 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 19 Nov 2012 13:04:11 +0000 (14:04 +0100)
If the user turned off GMX_GPU after a failed configure pass, some
variables were still left behind. Now these variables are marked as
advanced unconditionally.

Change-Id: Ia20ad5a164b6a8b43801ad1d83bc03332da5f6c1

CMakeLists.txt

index 7dd6f4540ad4ad95709be43f6be69b4dd911ec0e..b8aa8e05cba31ffdd8eb209df8bbf397e9e34ec7 100644 (file)
@@ -581,10 +581,11 @@ if(GMX_GPU)
     if(CMAKE_COMPILER_IS_GNUCC)
         set(GROMACS_LINKER_FLAGS "-Wl,--add-needed ${GROMACS_LINKER_FLAGS}")
     endif()
-
-    # annoyingly enough, FindCUDA leaves a few variables behind as non-advanced
-    mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_SDK_ROOT_DIR CUDA_VERBOSE_BUILD)
 endif()
+# Annoyingly enough, FindCUDA leaves a few variables behind as non-advanced.
+# We need to mark these advanced outside the conditional, otherwise, if the user
+# tuns GMX_GPU=OFF after a failed cmake pass, these variables will be left behind.
+mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_SDK_ROOT_DIR CUDA_VERBOSE_BUILD)
 
 if(APPLE)
    find_library(ACCELERATE_FRAMEWORK Accelerate)