Add cmake dependencies when they are needed

1 job for master in 1 minute and 47 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Linux
passed #1032028
masterJobLinux

00:01:47