Collaborative work from older repo (cmake improvements and warning fixes)