Add debug option to cmake.sh

Change some other stuff about cmake.sh