Backed out changes for 5366 - cmake build doesn't detect Metal on macOS These changes introduce regressions for other build environments, so I'm backing them out until we sort out the correct fix.