Fix inconsistently using #if or #ifdef instead of #if defined
First pass at getting cmake build to work with non-Windows systems.

Make doc building option dependent on asciidoc being installed
Fix MSVC build requiring cygwin.
Don't use try_run to get the version
Comments about ICC build failure with 12.x were crazy

Fix warnings with ICC.
Don't use the toplevel cmake paths so the build works as a subproject
Fix cmake build with sun studio
Generated header is not in ../src/
Fix NSIS installer errors, MinGW build.

The CPack NSIS installer was in a state where it would always give a
useless error. I think it was using stuff intended for running cpack
separately from cmake.
Fix MinGW32 build

Fix link errors when using -m32 with MinGW
Fix random 3 space tabs
Fix unused argument warnings
Fix -Wmissing-field-initializers
Fix -Wmismatched-tags
Fix some of the -Wshadows
Fix warnings with MinGW
Fix a couple more warnings
Fix typos
Merge pull request #492 from arsenm/master

Make CMake build usable for other systems