Here's my old attempt at a CMake port, including template for ppremake.