Recently a change to CFLAGS was committed that broke the build when buildinfo was enabled.
This patch avoids this happening again by using configure_file which handles escaping C-strings from CMake variables, without having to pass them as defines.
See the error from rBf2c7b4a1c54e: Re-enable WITH_COMPILER_SHORT_FILE_MACRO, fix build error..
- We could escape quotes by doing:
string(REPLACE "\"" "\\\"" BUILDINFO_CFLAGS "${BUILDINFO_CFLAGS}").
However I rather let CMake escape the string so we don't run into other corner cases where escaping fails later on. - Note that I don't think this is a very controversial change, I'd to be sure this works on other platforms besides Linux.