Compiling Blender with Optix on Ubuntu
The cmake patch for OptiX searches for the SDK in the following directories

SET(_optix_SEARCH_DIRS
  ${OPTIX_ROOT_DIR}
  "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.0.0"
  /usr/local
  /sw # Fink
  /opt/local # DarwinPorts
) 


Where OPTIX_ROOT_DIR can either be an environment variable or the path explicitly set by using -DOPTIX_ROOT_DIR when using cmake. $ENV{PROGRAMDATA} is the environment variable to the ProgramData directory, which would usually be C:\ProgramData.

So your OptiX SDK has to be in either one of these paths (although on Windows it should be C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.0.0) and you would have to create a release build. Alternatively you can configure the cmake setup yourself and specify that you want to use Optix (unless you do a release build) using WITH_CYCLES_DEVICE_OPTIX=ON and the path to the SDK OPTIX_ROOT_DIR=/path/to/NVIDIA-OptiX-SDK-7.x.x-xxx. This is described here, but can also be seen in the code of the patch. How to set these cmake variables is documented in Compile Blender with CMake for building on Linux in the section for Editing CMake Parameter which is pretty much the same on Windows.