Cmake refactoring