summaryrefslogtreecommitdiff
path: root/Modules/FindCUDA.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2017-12-30 07:33:11 +1100
committerCraig Scott <craig.scott@crascit.com>2017-12-30 09:35:56 +1100
commit3c413e2a31b4fcb6a99dba04669c6a6517b97832 (patch)
tree0e3f6f6776b682f43654f948886e34d482441aa2 /Modules/FindCUDA.cmake
parentc267ea1c3e54626e4ab2283dc7529ed8aa8beac8 (diff)
downloadcmake-3c413e2a31b4fcb6a99dba04669c6a6517b97832.tar.gz
GENERATOR_IS_MULTI_CONFIG: Use for multi-config checks in Modules
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r--Modules/FindCUDA.cmake15
1 files changed, 9 insertions, 6 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 04b5cf9fc0..24fe301a0e 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -578,12 +578,15 @@ mark_as_advanced(
CUDA_SEPARABLE_COMPILATION
)
-# Makefile and similar generators don't define CMAKE_CONFIGURATION_TYPES, so we
-# need to add another entry for the CMAKE_BUILD_TYPE. We also need to add the
-# standerd set of 4 build types (Debug, MinSizeRel, Release, and RelWithDebInfo)
-# for completeness. We need run this loop in order to accommodate the addition
-# of extra configuration types. Duplicate entries will be removed by
-# REMOVE_DUPLICATES.
+# 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)
foreach(config ${CUDA_configuration_types})