Controller design is an important problem for swarm robotics. Although many successful controllers have been proposed, most are hand-coded, sometimes using adaptive mechanisms to tune parameters of a manually designed algorithm. These solutions are generally tailored to specific environments, or problem instances, and often fail to scale well as swarm size is increased. This paper focuses on the problem of swarm foraging, proposing an automated method for designing scalable controllers that can perform effectively in multiple foraging environments. We use Neuroevolution of Augmented Topologies (NEAT) to design a neural network controller for a swarm of homogeneous robots. Our system, called NeatFA (NEAT Foraging Algorithm), is compared to existing swarm foraging algorithms, the Central Place Foraging Algorithm (CPFA), and the Distributed Deterministic Spiral Algorithm (DDSA). We find that NEAT produces controllers with performance that is comparable to both the CPFA and the DDSA. This is significant because the controller design was evolved automatically without preprogramming high-level behaviors or movements. The evolved neural network controller responds to sensed inputs and produces movements and actions that lead to effective collective foraging by the swarm. We find that the NeatFA controller performs comparably or outperforms the DDSA and CPFA for large swarm sizes. Finally, we show that a NeatFA general controller, when evolved for multiple environments but smaller swarm sizes, scales successfully to larger swarm sizes.