If making as one piece, I'd make the cam first – on the basis (from personal experience) that I am more likely to make a mess of cutting the cam than the gear. However, as advised above, I would make in 2 parts. Assuming that the assembly is being driven by a pinion with half the number of teeth, the adjustment for timing is rather coarse. One way of overcoming this is to pin the cam to the gear with a selection of holes. In this example, the holes are spaced by n teeth plus 1/3 and n + 2/3.

The pins are actually 12 BA screws.
HTH,
Rod