[CMake] Get rid of deprecated check_cxx_accepts_flag()
The CMake module TestCXXAcceptsFlag and the accompanying function check_cxx_accepts_flag() have been deprecated since CMake 3.0, the replacements are CheckCXXCompilerFlag and check_cxx_compiler_flag().
Thanks to Dirk Ribbrock for reporting the problem via email.