diff options
author | David Cole <david.cole@kitware.com> | 2011-12-06 20:08:03 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-12-06 20:08:03 (GMT) |
commit | de9dc82779346bef6dc05916b90d5d6af661dab8 (patch) | |
tree | 09f4eb87b1d091959f0745b09979d3c726f0b1e3 /Modules | |
parent | 35017df53ccd66fd6b73cdc2608ede5dfadfa4bb (diff) | |
parent | 83d4eeadac5a656949127d4e2b67c4e973bbab48 (diff) | |
download | CMake-de9dc82779346bef6dc05916b90d5d6af661dab8.zip CMake-de9dc82779346bef6dc05916b90d5d6af661dab8.tar.gz CMake-de9dc82779346bef6dc05916b90d5d6af661dab8.tar.bz2 |
Merge topic 'topics/FindCUDA/FixCUDAInUNCPath'
83d4eea Add work around for CUDA in UNC paths.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCUDA/make2cmake.cmake | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Modules/FindCUDA/make2cmake.cmake b/Modules/FindCUDA/make2cmake.cmake index 7fce167..d41b72d 100644 --- a/Modules/FindCUDA/make2cmake.cmake +++ b/Modules/FindCUDA/make2cmake.cmake @@ -54,13 +54,27 @@ if (${depend_text} MATCHES ".+") string(REGEX REPLACE "^ +" "" file ${file}) - if(NOT IS_DIRECTORY ${file}) + # OK, now if we had a UNC path, nvcc has a tendency to only output the first '/' + # instead of '//'. Here we will test to see if the file exists, if it doesn't then + # try to prepend another '/' to the path and test again. If it still fails remove the + # path. + + if(NOT EXISTS "${file}") + if (EXISTS "/${file}") + set(file "/${file}") + else() + message(WARNING " Removing non-existant dependency file: ${file}") + set(file "") + endif() + endif() + + if(NOT IS_DIRECTORY "${file}") # If softlinks start to matter, we should change this to REALPATH. For now we need # to flatten paths, because nvcc can generate stuff like /bin/../include instead of # just /include. get_filename_component(file_absolute "${file}" ABSOLUTE) list(APPEND dependency_list "${file_absolute}") - endif(NOT IS_DIRECTORY ${file}) + endif() endforeach(file) |