Add support for config flags supported by automake to cmake.
Support installation of headers and libraries using cmake.
Add warning as error, and some warning flags for non visual studio.

There have also been remove one warning, C4290, which is a warning
about Visual C++ not having checked exceptions implemented.

Unfortunately, check_c(xx)_compiler_flag doesnt like result names
with more than one -, meaning that testing flags with more than one
- in the name (more than one word) can't be done in a loop without
some more "clever" tricks.
Remove unreferenced variable e in the CHECK_THROWS macro.
Change to use the clang __has_attribute to check for noreturn.

The preferred way to check if clang supports noreturn is to use
__has_attribute(noreturn). Since that doesn't exist except in clang,
we need to define it to 0 for all compilers that don't have it
predefined.