Issues building C++ installation of pytorch, Cannot Find CUDA

I am trying to build a test .cpp in CLION as in the tutorial https://pytorch.org/cppdocs/installing.html#minimal-example

I am using

  • Cuda version 11.1
  • the nightly c++ release of pytorch (the one released today)
  • CUDNN version 8.0.4 for Cuda 11.1
  • The cygwin 64 compiler

After reloading the CMakeLists.txt file I get the message:
Caffe2: CUDA cannot be found. Depending on whether you are building Caffe2
or a Caffe2 dependent library, the next warning / error will give you more
info.

Where in cuda.cmake there is a call to the function find_package(CUDA).

I have set my environment variables to be:
CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1

as well as added
Toolkit\CUDA\v11.1\libnvvp;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin; to my path variable

Any insights to how to solve this problem appreciated.