fixed semicolon bug and added cmake support