cmake: compile files only one time
cmake: fix config headers generating
cmake: compile static version by default
cmake: fix Clang compilation
cmake: fix make install
cmake: fix tests compilation on Linux