Cuda & VS2012 in a build tree

Hi,

I try to integrate Cuda5.5 into our build tree which is based on build & nmake.
The problem is that nvcc complaints that it cannot find compatible compiler when I point it into the one we have in the tree (we use visual studio 2012 compiler). Setting paths to compiler in program files works OK but this is no-go due to automatized build system.

Do you know how to persuade nvcc to use cl.exe in our tree?

Also, uncommenting --use-local-env causes nvcc to hang.

!if defined(CUDA_SOURCES)
@echo Compiling CUDA files: (CUDA_SOURCES) (CUDA_TOOL)
(CUDA_TARGETS) \ (CUDA_INCLUDES)
(INCLUDES) \ (CUDA_DEFAULT_FLAGS)
–cl-version 2012\

–use-local-env \

    -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64" \

-ccbin “d:\OurTree\Tools\x86\amd64” \

    --keep-dir "$(OBJ_PATH)\$O" \
    -maxrregcount=0 --machine 64 --compile -cudart static -use_fast_math \
    $(CUDA_DEFINES) \
    -Xcompiler "$(CXX_DEFAULT_FLAGS)" \
    $(CUDA_SOURCES)

!endif

x86\amd64 is a copy of x86_amd64.

I found correct structure.
If anybody is interested, nvcc is trying to locate vc\redist{x86|x64}\Microsoft.VC110.CRT\ and uses that for compiler version verification. Compilers themselves must be located under *\vc\bin{x86|amd64}