I took a few courses where model estimation via Maximum Likelihood in Structural Equation Modeling was discussed. There was one definition of the normal-theory ML fitting function that I also found in classic literature (like Bollen, 1989):
$ \hat{F}_{ML} = \ln|\boldsymbol{\Sigma}(\boldsymbol{\theta})| + tr[\mathbf{S} \boldsymbol{\Sigma}(\boldsymbol{\theta})^{-1}] - \ln|\mathbf{S}|- p $
where $\boldsymbol{\Sigma}(\boldsymbol{\theta})$ is the model-implied covariance matrix, $\mathbf{S}$ is the observed sample covariance matrix and $p$ is the number of manifest variables. Bollen (1989) demonstrates that when $\hat{\boldsymbol{\Sigma}} = \mathbf{S}$ (and $\boldsymbol{\Sigma}(\boldsymbol{\theta})$ is substituted with $\hat{\boldsymbol{\Sigma}}$), $\hat{F}_{ML}$ is zero, thus representing perfect fit.
However, in the course I saw a specification like this:
$ \hat{F}_{ML} = \ln|\boldsymbol{\Sigma}(\boldsymbol{\theta})| + tr[\mathbf{S} \boldsymbol{\Sigma}(\boldsymbol{\theta})^{-1}] - \ln|\mathbf{S}|- p + [\mathbf{m}-\boldsymbol{\mu}(\boldsymbol{\theta})]'\boldsymbol{\Sigma}^{-1}[\mathbf{m}-\boldsymbol{\mu}(\boldsymbol{\theta})] $
where it seems like the meanstructure is added to the fitting function as well, where $\mathbf{m}$ is the observed mean vector and $\boldsymbol{\mu}(\boldsymbol{\theta})$ is the model-implied mean vector.
My assumption why there are these two different definitions is that in classical CFA (and many other types of more general SEM) the meanstructure is saturated and model misfit could not come from the meanstructure. This would mean that $[\mathbf{m}-\boldsymbol{\mu}(\boldsymbol{\theta})]$ is zero because $\mathbf{m}=\boldsymbol{\mu}(\boldsymbol{\theta})$ and the additional term would disappear. However, I could not find any literature that confirms this, so if anyone knows where the second (more general) specification is from or could explain it in more detail, I would be very grateful.