From 4b561b4cb528a3d6fee6baa79dacfff31923a9b6 Mon Sep 17 00:00:00 2001 From: James Bigler Date: Fri, 5 Feb 2016 14:32:01 -0700 Subject: [PATCH 1/2] FindCUDA: Fix for when a non-existent dependency file is found. Previously if a non-existent dependency file is found we set the file to "" and then do if(NOT IS_DIRECTORY "${file}"). Later we call get_filename_component on the empty file which returns basically the current build directory. Having a dependency on the current build directory is really annoying, because anything that compiles into that directory will change the file stamp and cause your files to rebuild every time you call make. :( --- Modules/FindCUDA/make2cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindCUDA/make2cmake.cmake b/Modules/FindCUDA/make2cmake.cmake index c433fa8ed..7b3ca03db 100644 --- a/Modules/FindCUDA/make2cmake.cmake +++ b/Modules/FindCUDA/make2cmake.cmake @@ -67,7 +67,7 @@ if (NOT "${depend_text}" STREQUAL "") endif() endif() - if(NOT IS_DIRECTORY "${file}") + if(file AND 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. From 81ecc7263754ad96e3aa77ec4d60b72c49cc1409 Mon Sep 17 00:00:00 2001 From: James Bigler Date: Fri, 5 Feb 2016 14:50:29 -0700 Subject: [PATCH 2/2] FindCUDA: Added some additional comments about non-existent dependency files. --- Modules/FindCUDA/make2cmake.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/FindCUDA/make2cmake.cmake b/Modules/FindCUDA/make2cmake.cmake index 7b3ca03db..b841f3b67 100644 --- a/Modules/FindCUDA/make2cmake.cmake +++ b/Modules/FindCUDA/make2cmake.cmake @@ -67,6 +67,8 @@ if (NOT "${depend_text}" STREQUAL "") endif() endif() + # Make sure we check to see if we have a file, before asking if it is not a directory. + # if(NOT IS_DIRECTORY "") will return TRUE. if(file AND 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