How to enable sanitizers for Visual Studio projects via CMake?

  address-sanitizer, c++, cmake, visual-studio

I need to set address sanitizers for my Visual Studio project via my CMake file. I can’t make use of the GUI option for enabling sanitizers in VS since I need sanitizers to be enabled in my CI/CD flow.

Source: Windows Questions C++