summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-31 13:30:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-31 13:31:06 (GMT)
commita50828cc519d57016acc86074a446181532974ce (patch)
treec936ff817ce58e16fd250f9230732c348f6640ff
parentf5b5a72096236cbcac46bbcf57c6e39a1909bb90 (diff)
parent9f74aaeb7d6649241c4a478410e87d092c462960 (diff)
downloadCMake-a50828cc519d57016acc86074a446181532974ce.zip
CMake-a50828cc519d57016acc86074a446181532974ce.tar.gz
CMake-a50828cc519d57016acc86074a446181532974ce.tar.bz2
Merge topic 'FindCUDA-restore-config-types'
9f74aaeb FindCUDA: Fix regression in per-config flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1725
-rw-r--r--Modules/FindCUDA.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 0decbb5..0a31ac2 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -585,6 +585,18 @@ mark_as_advanced(
CUDA_SEPARABLE_COMPILATION
)
+# Single config generators like Makefiles or Ninja don't usually have
+# CMAKE_CONFIGURATION_TYPES defined (but note that it can be defined if set by
+# projects or developers). Even CMAKE_BUILD_TYPE might not be defined for
+# single config generators (and should not be defined for multi-config
+# generators). To ensure we get a complete superset of all possible
+# configurations, we combine CMAKE_CONFIGURATION_TYPES, CMAKE_BUILD_TYPE and
+# all of the standard configurations, then weed out duplicates with
+# list(REMOVE_DUPLICATES). Looping over the unique set then ensures we have
+# each configuration-specific set of nvcc flags defined and marked as advanced.
+set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo)
+list(REMOVE_DUPLICATES CUDA_configuration_types)
+
###############################################################################
###############################################################################
# Locate CUDA, Set Build Type, etc.