apply CMake patch only when needed