diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2016-08-29 17:28:37 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2016-11-14 16:36:43 (GMT) |
commit | 4f5155f6aba7cb7cd8c0e5b75e43b38a70568eb1 (patch) | |
tree | f9985cf9906992c74390b8187fd9d4c3d371684e /Modules/CMakeDetermineCUDACompiler.cmake | |
parent | aaeee1ca72d4f8b09ebf98c3e3bd73d50c09c0d8 (diff) | |
download | CMake-4f5155f6aba7cb7cd8c0e5b75e43b38a70568eb1.zip CMake-4f5155f6aba7cb7cd8c0e5b75e43b38a70568eb1.tar.gz CMake-4f5155f6aba7cb7cd8c0e5b75e43b38a70568eb1.tar.bz2 |
CUDA: We now properly perform CUDA compiler identification.
Diffstat (limited to 'Modules/CMakeDetermineCUDACompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index fd87358..a6863ef 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -27,10 +27,16 @@ mark_as_advanced(CMAKE_CUDA_COMPILER) if(NOT CMAKE_CUDA_COMPILER_ID_RUN) set(CMAKE_CUDA_COMPILER_ID_RUN 1) - list(APPEND CMAKE_CUDA_COMPILER_ID_MATCH_VENDORS NVidia) - set(CMAKE_CUDA_COMPILER_ID_MATCH_VENDOR_REGEX_NVidia "nvcc: NVIDIA \(R\) Cuda compiler driver") + # Try to identify the compiler. + set(CMAKE_CUDA_COMPILER_ID) + set(CMAKE_CUDA_PLATFORM_ID) + file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in + CMAKE_CUDA_COMPILER_ID_PLATFORM_CONTENT) - set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdCXX/(\\./)?(CompilerIdCXX.xctest/)?CompilerIdCXX[ \t\n\\\"]") + list(APPEND CMAKE_CUDA_COMPILER_ID_MATCH_VENDORS NVIDIA) + set(CMAKE_CUDA_COMPILER_ID_MATCH_VENDOR_REGEX_NVIDIA "nvcc: NVIDIA \(R\) Cuda compiler driver") + + set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdCUDA/(\\./)?(CompilerIdCUDA.xctest/)?CompilerIdCUDA[ \t\n\\\"]") set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_INDEX 2) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) |