CMAKE Error: CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do not want CUDA

I am working on GPU workstation GeForce RTX 3090, Windows 11, CUDA 12.1 and trying to build Darknet. I have installed latest visual studio 17.12.3. During Cmake GUI configuring it shows
" Setting default vcpkg target triplet to x64-windows
vcpkg not found, toolchain not defined, using integrated libs on win32
Darknet_VERSION: 0.2.5.7
Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
The C compiler identification is MSVC 19.42.34435.0
The CXX compiler identification is MSVC 19.42.34435.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Looking for a CUDA compiler
Looking for a CUDA compiler - NOTFOUND
CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1
CUDACXX: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin\nvcc.exe
CMake Error at CMakeLists.txt:185 (message):
CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do
not want CUDA.

Configuring incomplete, errors occurred!"
…Tried many times but couldn’t solve. What can be the problem?