The existing CMake config scripts already use CMake 2.8 syntax, but the directive in the file states cmake_minimum_required(VERSION 2.6), which cannot work. Update minimum required version to 2.8 (released on 2009-09-25, so not exactly cutting edge either: http://www.cmake.org/Bug/changelog_page.php?version_id=51 ) and update CMake scripts to not use the ancient clumsy "if (cond) ... else(cond) ... endif(cond)" syntax anywhere, but favor the compact "if (cond) ... else() ... endif()" syntax instead.
Include Emscripten port specific SDL files in CMakeLists.txt
Avoid SDL CMakeLists.txt toolchain from smashing over the default Emscripten toolchain value for CMAKE_REQUIRED_FLAGS (which is "-s ERROR_ON_UNDEFINED_SYMBOLS=1"), which is necessary for check_function_exists() test to work when targeting Emscripten.
Pass -Wno-warn-absolute-paths by default when configuring with CMake, since it is very noisy and offers little info.
Set up default values to SDL2 CMake build according to supported Emscripten features.