Add CMAKE support for main files of agocontrol. Needs work!