Don't use deprecated API. Fix compiler warnings. Cmake cleanup. Remove cmake-generated file.