Any CAM package should be able to do this. The one I have is an industrial application, that while quite powerful, isn't the most user friendly. There's much easier stuff to learn on that will do anything a gun shop could need.
Millwrite is a cheap engraving package that works pretty well. It can be a little awkward at times to use depending on how you set up your post processor.
If your mill has a "Y" axis substitution then it's a snap. Just make your text on a flat plane using X/Y then stick the Y axis sub call at the head of the program.
For this you could use any software that'll generate in a 2 axis plane. Just have to spit out code and then attach the Y axis sub at the beginning of the program.
Something like this:
G90G40G98G0G28(generic safety line)
G55(work offset)
T1M6(tool call)
M03S3500(spindle on clockwise at 3500rpm)
M08(coolant on)
G43G0H01Z.1(tool length offset call with rapid move to .1 over the top of the part)
G107R.625 (Y axis substitution call with the R value being the radius of your cylinder)
Then the code for your text generated from whatever software package you decide to go with. It'll be all G1 and G2/G3 moves. The control will automatically interpret the Y axis moves and convert them to A rotary.
I think the code at the end is a g108 to cancel. That or a G80 to cancel any canned cycles.
The rub can be with the feedrates. A lot of 4th axis set ups run in degrees per minute or radians instead of IPM. This can really screw up how a tool moves across the cylinder. Keep your feedrates VERY conservative (unless you happen to really enjoy digging engraving tools out of the barrel cylinder when they snap) until you get this part sorted out.
Also, ensure you have an actual 4th axis and not a power rotary table as the two are different. 4th axis your good to go, a rotary table will burn up in short order as the motor isn't designed to run with a constant load. Just be sure ahead of time.
Your machine's book is your best guide as a lot of this is proprietary and can vary a bit from machine to machine. When in doubt TECH LINE!!
Good luck.
C