summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/ExportPTX/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CudaOnly/ExportPTX/CMakeLists.txt')
-rw-r--r--Tests/CudaOnly/ExportPTX/CMakeLists.txt7
1 files changed, 3 insertions, 4 deletions
diff --git a/Tests/CudaOnly/ExportPTX/CMakeLists.txt b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
index ff6e77c..ee5f54d 100644
--- a/Tests/CudaOnly/ExportPTX/CMakeLists.txt
+++ b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
@@ -34,16 +34,15 @@ static std::string ptx_paths = "$<TARGET_OBJECTS:CudaPTX>";
# need to also pass the --name option
set(output_file ${CMAKE_CURRENT_BINARY_DIR}/embedded_objs.h)
-get_filename_component(cuda_compiler_bin "${CMAKE_CUDA_COMPILER}" DIRECTORY)
+find_package(CUDAToolkit REQUIRED)
find_program(bin_to_c
NAMES bin2c
- PATHS ${cuda_compiler_bin}
+ PATHS ${CUDAToolkit_BIN_DIR}
)
if(NOT bin_to_c)
message(FATAL_ERROR
"bin2c not found:\n"
- " CMAKE_CUDA_COMPILER='${CMAKE_CUDA_COMPILER}'\n"
- " cuda_compiler_bin='${cuda_compiler_bin}'\n"
+ " CUDAToolkit_BIN_DIR='${CUDAToolkit_BIN_DIR}'\n"
)
endif()