Cmake fixed, test main added