diff options
author | James Bigler <jamesbigler@gmail.com> | 2015-04-16 16:27:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-04-20 18:44:17 (GMT) |
commit | 0ed22502a6057f989bc7855a5a69e5171e013048 (patch) | |
tree | 32f267810887eb273d68f68cb1f28d505c7053e3 /Modules | |
parent | 53ef9a0a9e2937cbda9939593188f3bc75ef24ee (diff) | |
download | CMake-0ed22502a6057f989bc7855a5a69e5171e013048.zip CMake-0ed22502a6057f989bc7855a5a69e5171e013048.tar.gz CMake-0ed22502a6057f989bc7855a5a69e5171e013048.tar.bz2 |
FindCUDA: Create output dir while compiling intermediate link file (#15016)
During compilation of the intermediate link file, the output directory
may not be present in Visual Studio builds. This fix makes sure the
output directory exists before generating the output file.
Suggested-by: Irwin Zaid
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDA.cmake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 1802e61..e8e1fb1 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1585,10 +1585,12 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options COMMENT "Building NVCC intermediate link file ${output_file_relative_path}" ) else() + get_filename_component(output_file_dir "${output_file}" DIRECTORY) add_custom_command( TARGET ${cuda_target} PRE_LINK COMMAND ${CMAKE_COMMAND} -E echo "Building NVCC intermediate link file ${output_file_relative_path}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${output_file_dir}" COMMAND ${CUDA_NVCC_EXECUTABLE} ${nvcc_flags} ${flags} -dlink ${object_files} -o "${output_file}" ) endif() |