I'm aware of the fact that there are similar questions on this forum but I could not find an answer that fits my problem.
Many textbooks state that a general solution to the Klein-Gordon equation \begin{equation} \left(\partial_\mu \partial^\mu + \left(\frac{mc}{\hbar}\right)^2\right) \psi(x^\mu) = 0\qquad (1) \end{equation} is given by $$\psi(x^\mu) = \int \frac{d^4k}{\sqrt{2\pi}^4}\delta\left(k_\mu k^\mu-\left(\frac{mc}{\hbar}\right)^2\right) A(k^\mu) \text{e}^{-ik_\mu x^\mu},$$ where $k^\mu$ is the Lorentz invariant wave four-vector, $\delta(.)$ is the $\delta$-distribution and $A(k^\mu)$ is some arbitrary complex function.
I assume that this result is obtained by applying a Fourier transformation to equation $(1)$, but I cannot find out where the $\delta$-function in the integral comes from. The solution cannot be that difficult (since I've not found an answer yet), so I hope someone is willing to show me how one gets the expression for $\psi(x^\mu)$ by a Fourier transformation of the Klein-Gordon equation.