cmake: use execute_process rather than exec_program

exec_program is deprecated and execute_process is its replacement.