  We develop a virtual cycle approach towards generalized Donaldson-Thomas
theory of Calabi-Yau threefolds. Let $\mathcal{M}$ be the moduli stack of
Gieseker semistable sheaves of fixed topological type on a Calabi-Yau threefold
$W$. We construct an associated Deligne-Mumford stack $\widetilde{\mathcal{M}}$
with an induced semi-perfect obstruction theory of virtual dimension zero and
define the generalized Donaldson-Thomas invariant of $W$ via Kirwan blowups to
be the degree of the virtual cycle $[\widetilde{\mathcal{M}}]^{\mathrm{vir}}$.
We show that it is invariant under deformations of the complex structure of
$W$.
