Just in case if this helps:
My cmake output from Visual Studio 2019 version.
1> CMake generation started for configuration: 'x64-Release'.
1> Command line: "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\krshr\OneDrive\Documents\GitHub\Digit-3\out\install\x64-Release" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.21.27702/bin/HostX64/x64/cl.exe" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.21.27702/bin/HostX64/x64/cl.exe" -DCMAKE_PREFIX_PATH=C:\Users\krshr\Downloads\libtorch\libtorch -DCMAKE_BUILD_TYPE="Release" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Users\krshr\OneDrive\Documents\GitHub\Digit-3"
1> Working directory: C:\Users\krshr\OneDrive\Documents\GitHub\Digit-3\out\build\x64-Release
1> [CMake] -- Looking for pthread.h
1> [CMake] -- Looking for pthread.h - not found
1> [CMake] -- Found Threads: TRUE  
1> [CMake] CMake Warning (dev) at C:/Users/krshr/Downloads/libtorch/libtorch/share/cmake/Caffe2/public/utils.cmake:57 (if):
1> [CMake]   Policy CMP0054 is not set: Only interpret if() arguments as variables or
1> [CMake]   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
1> [CMake]   details.  Use the cmake_policy command to set the policy and suppress this
1> [CMake]   warning.
1> [CMake] 
1> [CMake]   Quoted variables like "MSVC" will no longer be dereferenced when the policy
1> [CMake]   is set to NEW.  Since the policy is not set the OLD behavior will be used.
1> [CMake] Call Stack (most recent call first):
1> [CMake]   C:/Users/krshr/Downloads/libtorch/libtorch/share/cmake/Caffe2/Caffe2Config.cmake:121 (caffe2_interface_library)
1> [CMake]   C:/Users/krshr/Downloads/libtorch/libtorch/share/cmake/Torch/TorchConfig.cmake:40 (find_package)
1> [CMake]   CMakeLists.txt:3 (find_package)
1> [CMake] This warning is for project developers.  Use -Wno-dev to suppress it.
1> [CMake] CMake Warning (dev) at C:/Users/krshr/Downloads/libtorch/libtorch/share/cmake/Torch/TorchConfig.cmake:80 (if):
1> [CMake]   Policy CMP0054 is not set: Only interpret if() arguments as variables or
1> [CMake]   keywords when unquoted.  Run "cmake --help-policy CMP0054" for policy
1> [CMake]   details.  Use the cmake_policy command to set the policy and suppress this
1> [CMake]   warning.
1> [CMake] 
1> [CMake]   Quoted variables like "MSVC" will no longer be dereferenced when the policy
1> [CMake]   is set to NEW.  Since the policy is not set the OLD behavior will be used.
1> [CMake] Call Stack (most recent call first):
1> [CMake]   CMakeLists.txt:3 (find_package)
1> [CMake] This warning is for project developers.  Use -Wno-dev to suppress it.
1> [CMake] -- Found torch: C:/Users/krshr/Downloads/libtorch/libtorch/lib/torch.lib  
1> [CMake] -- Configuring done
1> [CMake] -- Generating done
1> [CMake] -- Build files have been written to: C:/Users/krshr/OneDrive/Documents/GitHub/Digit-3/out/build/x64-Release
1> [CMake] 
1> Extracted includes paths.
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> CMake generation finished.