Fix cmake headless build.