summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-09-14 14:39:24 (GMT)
committerBrad King <brad.king@kitware.com>2023-09-21 19:34:23 (GMT)
commit72efbeadae4b99db0d26802d95771873873151db (patch)
tree768d8ee86fad705daa87f10e1fe49dc0d8e6f587 /Modules
parent711de9aef6d900ffd52d8b540161945fa405c684 (diff)
downloadCMake-72efbeadae4b99db0d26802d95771873873151db.zip
CMake-72efbeadae4b99db0d26802d95771873873151db.tar.gz
CMake-72efbeadae4b99db0d26802d95771873873151db.tar.bz2
CUDA: Simplify CMAKE_GENERATOR references for determining compiler
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 53c5f78..de765d7 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -4,13 +4,13 @@
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
-if( NOT ( ("${CMAKE_GENERATOR}" MATCHES "Make") OR
- ("${CMAKE_GENERATOR}" MATCHES "Ninja") OR
- ("${CMAKE_GENERATOR}" MATCHES "Visual Studio (1|[9][0-9])") ) )
+if(NOT ((CMAKE_GENERATOR MATCHES "Make") OR
+ (CMAKE_GENERATOR MATCHES "Ninja") OR
+ (CMAKE_GENERATOR MATCHES "Visual Studio (1|[9][0-9])")))
message(FATAL_ERROR "CUDA language not currently supported by \"${CMAKE_GENERATOR}\" generator")
endif()
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
if(DEFINED ENV{CUDAHOSTCXX} OR DEFINED CMAKE_CUDA_HOST_COMPILER)
message(WARNING "Visual Studio does not support specifying CUDAHOSTCXX or CMAKE_CUDA_HOST_COMPILER. Using the C++ compiler provided by Visual Studio.")
endif()
@@ -62,7 +62,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
- if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+ if(CMAKE_GENERATOR MATCHES "Visual Studio")
# We will not know CMAKE_CUDA_COMPILER until the main compiler id step
# below extracts it, but we do know that the compiler id will be NVIDIA.
set(CMAKE_CUDA_COMPILER_ID "NVIDIA")
@@ -306,7 +306,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
CMAKE_DETERMINE_COMPILER_ID(CUDA CUDAFLAGS CMakeCUDACompilerId.cu)
- if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+ if(CMAKE_GENERATOR MATCHES "Visual Studio")
# Now that we have the path to nvcc, we can compute the toolkit root.
get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${CMAKE_CUDA_COMPILER}" DIRECTORY)
get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${CMAKE_CUDA_COMPILER_TOOLKIT_ROOT}" DIRECTORY)
@@ -331,7 +331,7 @@ if(MSVC_CUDA_ARCHITECTURE_ID)
"set(MSVC_CUDA_ARCHITECTURE_ID ${MSVC_CUDA_ARCHITECTURE_ID})")
endif()
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(CMAKE_CUDA_HOST_LINK_LAUNCHER "${CMAKE_LINKER}")
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "")
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "")