PS. If you're not super comfortable with CMake, I can make these changes after merge.