fixed cmake debug issue

Anthony pushed this to my branch. We were telling CMake to do a release build in all situations, even if the user specified debug mode. This should be fixed now.