diff options
author | Brad King <brad.king@kitware.com> | 2021-05-07 13:12:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-05-07 13:12:08 (GMT) |
commit | 26751418a3d475bc45a9cbd82b7eede61753e2d1 (patch) | |
tree | 6ca72c0fea158ccaa67da3fe46936261412420d1 /Modules | |
parent | f0ecd9130131a72cef3f1d2fd6a9ac762db61aa2 (diff) | |
parent | 5e931c5a97380cea3989084007aed3e797fc4438 (diff) | |
download | CMake-26751418a3d475bc45a9cbd82b7eede61753e2d1.zip CMake-26751418a3d475bc45a9cbd82b7eede61753e2d1.tar.gz CMake-26751418a3d475bc45a9cbd82b7eede61753e2d1.tar.bz2 |
Merge topic 'improve_cuda_toolkit_extraction_regex'
5e931c5a97 CUDA: improve regex for CUDA Toolkit root from nvcc verbose output
Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6094
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCUDACompiler.cmake | 2 | ||||
-rw-r--r-- | Modules/FindCUDA.cmake | 2 | ||||
-rw-r--r-- | Modules/FindCUDAToolkit.cmake | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index 38c5e9c..e360d31 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -186,7 +186,7 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN) # itself, allowing us to support numerous different scattered toolkit layouts execute_process(COMMAND ${_CUDA_NVCC_EXECUTABLE} "-v" "__cmake_determine_cuda" OUTPUT_VARIABLE _CUDA_NVCC_OUT ERROR_VARIABLE _CUDA_NVCC_OUT) - if(_CUDA_NVCC_OUT MATCHES "TOP=([^\r\n]*)") + if(_CUDA_NVCC_OUT MATCHES "\\#\\$ TOP=([^\r\n]*)") get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${CMAKE_MATCH_1}" ABSOLUTE) else() get_filename_component(CMAKE_CUDA_COMPILER_TOOLKIT_ROOT "${_CUDA_NVCC_EXECUTABLE}" DIRECTORY) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 620e32a..16d7571 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -839,7 +839,7 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR AND NOT CMAKE_CROSSCOMPILING) # itself, allowing us to support numerous different scattered toolkit layouts execute_process(COMMAND ${CUDA_TOOLKIT_ROOT_DIR_NVCC} "-v" "__cmake_determine_cuda" OUTPUT_VARIABLE _CUDA_NVCC_OUT ERROR_VARIABLE _CUDA_NVCC_OUT) - if(_CUDA_NVCC_OUT MATCHES "TOP=([^\r\n]*)") + if(_CUDA_NVCC_OUT MATCHES "\\#\\$ TOP=([^\r\n]*)") get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CMAKE_MATCH_1}" ABSOLUTE CACHE) else() get_filename_component(CUDA_TOOLKIT_ROOT_DIR "${CUDA_TOOLKIT_ROOT_DIR_NVCC}" DIRECTORY) diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index de2b068..8801cb1 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -524,7 +524,7 @@ else() # NVIDIA HPC SDK, and distro's splayed layouts execute_process(COMMAND ${CUDAToolkit_NVCC_EXECUTABLE} "-v" "__cmake_determine_cuda" OUTPUT_VARIABLE _CUDA_NVCC_OUT ERROR_VARIABLE _CUDA_NVCC_OUT) - if(_CUDA_NVCC_OUT MATCHES "TOP=([^\r\n]*)") + if(_CUDA_NVCC_OUT MATCHES "\\#\\$ TOP=([^\r\n]*)") get_filename_component(CUDAToolkit_BIN_DIR "${CMAKE_MATCH_1}/bin" ABSOLUTE) else() get_filename_component(CUDAToolkit_BIN_DIR "${CUDAToolkit_NVCC_EXECUTABLE}" DIRECTORY) |