diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2016-05-24 13:15:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-25 13:31:35 (GMT) |
commit | 6b190b5c5221d2447bdf19c20243469025d2614e (patch) | |
tree | 3b8c9aa1dfe5717bafced37571fd2293c416f036 /Modules/FindCUDA.cmake | |
parent | c75d91a05c9f442582726e3e80fec41d016da76f (diff) | |
download | CMake-6b190b5c5221d2447bdf19c20243469025d2614e.zip CMake-6b190b5c5221d2447bdf19c20243469025d2614e.tar.gz CMake-6b190b5c5221d2447bdf19c20243469025d2614e.tar.bz2 |
FindCUDA: Add support for generator expressions in CUDA_NVCC_FLAGS
Follow the configure_file by a file(GENERATE) so the resulting cmake
scripts used by FindCUDA for wrapping nvcc calls can now support
generator expressions in the CUDA_NVCC_FLAGS variable.
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r-- | Modules/FindCUDA.cmake | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 0718116..2979f0f 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -1395,7 +1395,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) set(cmake_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.depend") set(NVCC_generated_dependency_file "${cuda_compile_intermediate_directory}/${generated_file_basename}.NVCC-depend") set(generated_cubin_file "${generated_file_path}/${generated_file_basename}.cubin.txt") - set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake") + set(custom_target_script_pregen "${cuda_compile_intermediate_directory}/${generated_file_basename}.cmake.pre-gen") + set(custom_target_script "${cuda_compile_intermediate_directory}/${generated_file_basename}$<$<BOOL:$<CONFIG>>:.$<CONFIG>>.cmake") # Setup properties for obj files: if( NOT cuda_compile_to_external_module ) @@ -1436,7 +1437,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files) endif() # Configure the build script - configure_file("${CUDA_run_nvcc}" "${custom_target_script}" @ONLY) + configure_file("${CUDA_run_nvcc}" "${custom_target_script_pregen}" @ONLY) + file(GENERATE + OUTPUT "${custom_target_script}" + INPUT "${custom_target_script_pregen}" + ) # So if a user specifies the same cuda file as input more than once, you # can have bad things happen with dependencies. Here we check an option |