file(DOWNLOAD) fails if given just a file name to write to
Minimal example reproducing the problem:
file(DOWNLOAD http://www.google.com somepage.html)
Save the above to a file and run it with cmake -P
gives an error message similar to the following:
CMake Error at doit.cmake:1 (file):
file DOWNLOAD error: cannot create directory '' - Specify file by full path
name and verify that you have directory creation and file write privileges.
Providing either a relative or absolute path to the target file makes the example work (the target directory does not have to exist yet):
file(DOWNLOAD http://www.google.com foo/somepage.html)
Even just prepending ./
works:
file(DOWNLOAD http://www.google.com ./somepage.html)