You'll need to have SDL2 installed on your package manager. I'm not sure how it'd work with Visual Studio, though.
For Visual Studio, I use the VC development libraries from https://www.libsdl.org/download-2.0.php. I put the following sdl2-config.cmake file in the SDL2-2.0.14 directory: Code (Text): set(SDL2_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/include") # Support both 32 and 64 bit builds if (${CMAKE_SIZEOF_VOID_P} MATCHES 8) set(SDL2_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/x64/SDL2.lib;${CMAKE_CURRENT_LIST_DIR}/lib/x64/SDL2main.lib") else () set(SDL2_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/x86/SDL2.lib;${CMAKE_CURRENT_LIST_DIR}/lib/x86/SDL2main.lib") endif () string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES) Then I added -DSDL2_DIR=YOUR_PATH_HERE\SDL2-2.0.14 to the end of my cmake arguments:
For my builds, I used vcpkg to get SDL2. It essentially gives MSVC a package manager, though it's a little complicated to figure out.