[cmake] clean up cmake/Utils.cmake (#47923)
Summary:
Consolidate into cmake/public/utils.cmake
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47923
Reviewed By: samestep
Differential Revision: D24955961
Pulled By: walterddr
fbshipit-source-id: 9d5f6af2b353a8c6f6d521c841fd0989393755cd