  This paper presents the CMS measurements of quarkonia and open heavy flavor
production in \pp, \pPb, and \PbPb collisions at \sqrtsnn = 2.76 and 5.02 TeV.
A brief outlook of the near-future CMS heavy flavor physics analyses is
provided at the end.
