Smoke em if you got em

Hey, does anyone know where that expression comes from?
Thank You

I cant find my source on this quote but I think it has a military origin--Navy I believe.
This was said to the crew at certain pre-determined times.
Smoking aboard wooden ships was very dangerous so lighting matches and smoking tobacco was limited to certain times and places.
Maybe someone else can confirm this.