Changed CMake module to make use of HTTP response code.