Implementation for CMake

@satoshikumano please review.