fix rng cmake logic