Yes in CMake : https://github.com/Eyescale/CMake/pull/103/files
It is not so very long, we can inline it here if you prefer. I wasn't sure what the best option was: Inline, in Buildyard/CMake or in CMake..