Refs #7830 - Use different Cmake variable.

This takes into account Martyn's changes on #8097, which should be merged
into this branch from master once his ticket has passed testing.