gtest: support an external gtest
daemon_tests: update cmake code

It's still not valid, but it's commented out anyways; update to code so
it matches the style at least.
miniupnpc: clear out else/endfoo command arguments
cmake: factor out error messages

Instead of using BoldRed and ColourReset everywhere, wrap it up in a
function.
cmake: remove configuration variables

CMAKE_BUILD_TYPE is meant for single-config build tools (e.g., make and
ninja) while CMAKE_CONFIGURATION_TYPES is meant for multi-config build
tools (e.g., Xcode and Visual Studio). They should not be mixed or
manually set.
cmake: fix up BOOST_IGNORE_SYSTEM_PATHS

The option was set twice when it only needs to be set once. Also fix a
bogus dereference and spurious whitespace.
cmake: support git info in released tarballs
build: inform the build of what generates version.h

Without this, Ninja requires a two-step process because it doesn't know
what generates version.h it sees from its depfile support and when it
changes in one run, it has already pruned the dependent nodes from its
internal graph and requires a second run to catch it.