fix reference iteration, take 2
Minor cmake fix