Hello. Looks like SDL2main is not present on some Linux distros (Fedora in my case).
gmake[3]: *** No rule to make target 'SDL2main_LIBRARIES-NOTFOUND', needed by 'target'. Stop.
gmake[2]: *** [CMakeFiles/Makefile2:76: CMakeFiles/target.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/target.dir/rule] Error 2
gmake: *** [Makefile:118: target] Error 2
if(NOT TARGET SDL2::SDL2)
add_library(SDL2::SDL2 UNKNOWN IMPORTED)
set_target_properties(SDL2::SDL2 PROPERTIES
INTERFACE_LINK_LIBRARIES SDL2::Core
IMPORTED_LOCATION ${SDL2_LIBRARY}) # Was IMPORTED_LOCATION ${SDL2main_LIBRARIES}
endif()