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. :(
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block. This is no longer the preferred style.
Run the following shell code:
for c in else endif endforeach endfunction endmacro endwhile; do
echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
Nvcc can emit '/path' instead of '//path' which can cause a lot of grief later. We test
to see if the file exists, if it doesn't then we see if the file exists with '/'
prepended. Files that don't exist won't be added to the list.