Convert problem 4 to cmake