migrate from Makefile to CMake