CMake + CPack

Merge lamvak's fork with fixes