Of course the part of the patch I wrote myself had to be wrong. Adjust the regexp to make it look like the others and work with all CMake versions.