Cmake implementations

@satoshikumano please review.