better error checking in some cmake modules that use external commands

better error checking in some cmake modules that use external commands