Getting number of programs from cmake.