Get smarter about setting build type

I forgot that you have to set it as a CACHE variable.