Porting to CMake