Visual Studio Pre build events and batch set
- by helloworld922
Hi, I'm trying to create call a batch file which sets a bunch of environment variables prior to building.
The batch file looks something like this (it's automatically generated before-hand to detect ATI Stream SDK or NVidia CUDA toolkit):
set OCL_LIBS_X86="%ATISTREAMSDKROOT%libs\x86"
set OCL_LIBS_X64="%ATISTREAMSDKROOT%libs\x86_64"
set OCL_INCLUDE="%ATISTREAMSDKROOT%include"
However, the rest of the build doesn't seem to have access to these variables, so when I try to reference $(OCL_INCLUDE) in the C/C++GeneralAdditional include directories, it will first give me warning that environment variable $(OCL_INCLUDE) was not found, and when I try to include CL/cl.hpp the compile will fail with:
fatal error C1083: Cannot open include file: 'CL/cl.hpp': No such file or directory
I know that I could put these variables into the registry if I wanted to access them from the visual studio GUI, but I would really prefer not to do this. Is there a way to to get these environment variables to stick after the pre-build events? I can't reference $(ATISTREAMSDKROOT) directly because the project must be able to build for both ATI Stream and NVidia Cuda.