Implementation fo CMake

@satoshikumano please review.