[CUDA][MSVC] 3.9.0-rc6 Error when compiling cuda files on different drives
Simple example fails to compile in Visual Studio when building in some other directory
CMakeLists.txt
cmake_minimum_required(VERSION 3.9.0)
project(Test)
enable_language(CUDA)
add_executable(main main.cu)
main.cu
int main()
{
return 0;
}
cd Z:\test
cmake -G "Visual Studio 14 2015 Win64" X:\test
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.targets(420,9): error MSB3191: Unable to create directory "main.dir\Debug\X:\test\". The given path's format is not supported.
It boils down to CudaCompile
having an absolute path and "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.props" using %(RelativeDir)
for generating the intermediate directory. Because it's on different drives %(RelativeDir)
just outputs the full path. I guess it's more of a CUDA issue but it will be a problem for CMake users that want to use the new cuda integration.
I'm using Visual Studio 2015 Update 3, CUDA 8.0.61 and CMake 3.9.0-rc6
Edited by Francisco Facioni