Cmake porting and more debug info

Added intial config.h generation
Added examples CMakeLists.txt
Added more output to 500