Ewan McGregor has signed on to co-star in the Amelia Earhart biopic Amelia for Fox Searchlight.

Hilary Swank, Richard Gere and Virginia Madsen have already boarded the project, which Mira Nair is helming.

According to Variety, the story centers on the legendary aviatrix (Swank) and chronicles her rise to fame, marriage to publisher George Putnam (Gere) and passionate affair with Gene Vidal (McGregor), father of author Gore Vidal. Ronald Bass penned the screenplay.

The filmmakers have long been trying to land McGregor but were having trouble working out the scheduling. The actor is about to wrap "I Love You, Philip Morris" alongside Jim Carrey and will begin work on Ron Howard's "Da Vinci Code" follow-up Angels and Demons in early June. McGregor will sandwich the Amelia role in between.

The film is shooting in Toronto.