CMake refactoring