changed cmake scripts to allow building as subproject / moved common configuration from startup scripts to separate script