Add support for config flags supported by automake to cmake.
Support installation of headers and libraries using cmake.
Add warning flags for non Visual Studio targets.

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.