summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDA.cmake
diff options
context:
space:
mode:
authorMarcel Loose <loose@astron.nl>2013-04-18 18:48:17 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2013-04-18 19:15:51 (GMT)
commit32b582d8a583fcaea92eff4b33af62ab0e10ceaa (patch)
tree7cbe52548c73ea990f49c55e3662ad363f017905 /Modules/FindCUDA.cmake
parent6a3ee5dd4e177c007459218612c45f9e6c9ec83b (diff)
downloadCMake-32b582d8a583fcaea92eff4b33af62ab0e10ceaa.zip
CMake-32b582d8a583fcaea92eff4b33af62ab0e10ceaa.tar.gz
CMake-32b582d8a583fcaea92eff4b33af62ab0e10ceaa.tar.bz2
FindCUDA: Remove duplicate entries from INCLUDE_DIRECTORIES.
As of CMake 2.8.8, the INCLUDE_DIRECTORIES() command does not de-duplicate entries. Failure to do so can lead to an extremely long and repetitive list of -I entries on the command line.
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r--Modules/FindCUDA.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 423ad3d..6a1a27e 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1021,7 +1021,10 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Initialize our list of includes with the user ones followed by the CUDA system ones.
set(CUDA_NVCC_INCLUDE_ARGS ${CUDA_NVCC_INCLUDE_ARGS_USER} "-I${CUDA_INCLUDE_DIRS}")
# Get the include directories for this directory and use them for our nvcc command.
+ # Remove duplicate entries which may be present since include_directories
+ # in CMake >= 2.8.8 does not remove them.
get_directory_property(CUDA_NVCC_INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES)
+ list(REMOVE_DUPLICATES CUDA_NVCC_INCLUDE_DIRECTORIES)
if(CUDA_NVCC_INCLUDE_DIRECTORIES)
foreach(dir ${CUDA_NVCC_INCLUDE_DIRECTORIES})
list(APPEND CUDA_NVCC_INCLUDE_ARGS -I${dir})