I think using cmake's configure_file is the better approach, because it also works for nightly builds:
configure_file
https://invent.kde.org/kde/kdenlive/merge_requests/27