CMake migration

Some fixes cmake