[cmake] move macro around