  We study compact gravitating $Q$-ball, $Q$-shell solutions in a sigma model
with the target space $\mathbb{C}P^N$. Models with odd integer $N$ and suitable
potential can be parameterized by $N$-th complex scalar fields and they support
compact solutions. A coupling with gravity allows for harboring of the
Schwarzschild black holes for the $Q$-shell solutions. The energy of the
solutions behaves as $E\sim |Q|^{5/6}$, where $Q$ stands for the $U(1)$ Noether
charge, for both the gravitating and the black hole solutions.Notable
difference from the solutions of the flat space is that upper bound of $|Q|$
appears when the coupling with gravity is stronger. The maximal value of $|Q|$
quickly reduces for larger coupling constant. It may give us a useful hint of
how a star forms its shape with a certain finite number of particles.
