Roald Dahl famously loathed all the movie adaptations of his books, including the 1971 classic “Willy Wonka and the Chocolate Factory” starring Gene Wilder. So when the beloved author died in 1990, his widow Felicity (who goes by Liccy) was torn about what to do with his catalogue. It was a time, following the hit comedy “Home Alone,” where the major studios were vigorously chasing family-friendly tales, and many of Dahl’s stories fit the bill. But Liccy didn’t want celebrated bestsellers such as “Matilda” or “James and the Giant Peach” falling into the wrong hands.

Dahl’s publisher at Penguin Books set up a few meetings, and she eventually connected with literary agent Michael Siegel. They bonded right away. “I don’t want there to be bad movies,” Liccy told him. They came up with an unorthodox, boutique approach. “Rather than sell the stories directly to the studios, we would wait to meet up with a filmmaker with a passion for a story,” Siegel explains. And, in the most un-Hollywood move of all, the deals wouldn’t allow for sequels or spinoffs.

Since then, Siegel has been Hollywood’s liaison to the Dahl estate. He’s helped produce and shepherd such titles to the big screen as the 2005 Tim Burton remake of “Charlie and the Chocolate Factory,” Wes Anderson’s “The Fantastic Mr. Fox” and Steven Spielberg’s “The BFG,” which opens this weekend. In a lengthy interview, Siegel shared stories about how each project got off the ground, and the casting decisions — like the time Robin Williams underwhelmed as the Big Friendly Giant — that were not meant to be.

1. “James and the Giant Peach” (1996)

Box office: $28.9 million

Following 1993’s “The Nightmare Before Christmas,” director Henry Selick wanted to do a stop-motion version of “James and the Giant Peach,” based on the 1961 novel about an orphan who boards an oversized fruit. He invited Liccy to his workshop in San Francisco to show her how the movie would be done. “She walked out into the parking lot with me and burst into tears and said, ‘I can’t not give this to them,’” Siegel says.

“James” sold to Disney in 1992, and the family was happy with the finished movie. But it was a tumultuous road, as Liccy witnessed the ups and downs of developing a script at a studio. “The range of what you can get is vast and frightening,” Siegel says. “She said, ‘Next time, can we control the process of developing the screenplay?’” Siegel thought about it, and told Liccy there might be a way.

2. “Matilda” (1996)

Box office: $33.5 million

Siegel brought in two of his screenwriting friends — Nicholas Kazan and Robin Swicord — and asked them if they’d take a crack at adapting one of Dahl’s most beloved novels about a young girl with telekinetic powers. They wouldn’t be paid up front, but would be compensated if the family approved of the script. Liccy flew in from London for a dinner in Santa Monica with the screenwriting team, and awaited a draft. When she received it more than a year later, she loved it so much. In fact, she had almost no notes for them.

Danny DeVito had expressed interest in directing the film, and the estate brought him on board. Then they held an auction for the movie in 1994, which practically every studio bid on. It ended up at TriStar Pictures for a then-record $4 million for rights to the book and script. “We were able to bring it to the studio with complete script approval,” Siegel says. “Nothing could be changed without the estate’s blessing.”

3. “Charlie and the Chocolate Factory” (2005)

Box office: $206.5 million

Because of the previous movie, Warner Bros. had partial rights to “Charlie,” yet they had lapsed in 1992. The estate entered into talks in the late ‘90s for a remake at WB. But it would be another six years before a deal was complete. At first, Scott Frank (“Minority Report” and “Out of Sight”) was brought in to work on a script for director Gary Ross. “Scott got writer’s block,” Siegel recalls. “He said it was, for him, unadaptable because it was too episodic and he didn’t want to tamper with a classic too much.” He never finished a draft, and Ross exited the project. “Then we were shipwrecked.”

Alan Horn, who served as the chief of Warner Bros. at the time, took a meeting with Liccy to get the project back on track. The Dahl estate provided a list of seven dream directors for the project — including Ang Lee, Terry Gilliam, Anthony Minghella and Spike Jonze. “We had some artsy people,” says Siegel. For commercial reasons, on a blockbuster with an eventual budget of $150 million, Horn gravitated to just one of those names on the list: Tim Burton. “It was going to be a longshot,” Siegel recalls. But Burton quickly expressed interest.

Pamela Pettler wrote a faithful adaptation the Dahl family approved. The studio then greenlit “Charlie and the Chocolate Factory,” with Johnny Depp attached to star. But Burton asked for a rewrite and brought in his screenwriter collaborator John August (“Big Fish”). “He didn’t even read Pamela’s script and started fresh,” Siegel says. “We liked John’s script, but we were queasy that he went into Wilber Wonka.” The new script deviated from the book in a major way by adding flashbacks with Wonka’s dad, a dentist who never let his son eat chocolates growing up, as an explanation for why the iconic character went into the candy business. After deliberating about it, the family eventually decided to support Burton’s vision and approve the final screenplay. “Charlie and the Chocolate Factory” went on to become the most successful Dahl adaptation yet, with a worldwide gross of $475 million.

4. “Fantastic Mr. Fox” (2009)

Box office: $21 million

Siegel recalls meeting with Wes Anderson shortly after his first feature “Bottle Rocket” came out in 1996. The young director pitched himself on an adaption of the 1970 novella about a sly fox that outsmarts three farmers by swiping their chickens and food. But he wasn’t sure how he’d pull it off — with puppets or animation (he’d later settle on stop motion). “He wanted to write the script and think about it,” Siegel says. However, Anderson got sidetracked and made “The Royal Tenenbaums” next.

When he eventually returned to “Fox,” he visited Liccy at Dahl’s home outside London, and he was so taken by the environment that he temporarily moved himself onto the property to write the script. “He soaked up the particulars of that place in such detail, it was remarkable,” Siegel says. For example, the office where Mr. Fox (George Clooney) resides is an homage to Dahl’s own writing space. Anderson broadened the characters, so that the story became more of a family dramedy. In the movie, there’s an expanded role for the protagonist’s spouse Mrs. Fox (voiced by Meryl Streep) and obsessive-compulsive son (Jason Schwartzman).

“That was the first script that significantly departed from the book,” Siegel says. “But it was so winning and clearly in the spirit of Roald Dahl. It was a complete endorsement and love affair.”

5. “The BFG” (2016)

When Siegel first met with Liccy, he said that his one regret was that the author had already sold the rights to “The BFG” to a British company that had turned the story into a 1989 animated film. “I was going to make it my mission to get the rights back,” he says. “It took some time, but we pulled it off.” Paramount optioned the rights to Dahl’s Big Friendly Giant around 1994, and brought in the “Matilda” writing duo of Kazan and Swicord to try their hand at a script. After they had a draft, producer Kathleen Kennedy landed Williams to come in for a test.

“The reading was actually surprisingly disappointing,” Siegel says. The BFG speaks in his own dialect, which Williams had trouble establishing. “He was sort of improvising on the jumbled language. And it was clunky. It was strangely not working. It was harder than it looks even for Robin. It didn’t quite deliver. So that was a humbling experience for us.”

Williams was still interested in playing the character, but the studio had trouble securing a director for the project. “We wondered if we had to have a new screenplay,” Siegel says. “We were hearing that people were daunted by the production demands.” That was followed by new script attempts by Terry Jones (of Monty Python fame) and Ed Solomon, until Kennedy was able to get “ET” scribe Melissa Mathison to agree to come out of movie retirement. By then, the rights had lapsed from Paramount, and Mathison cranked out her version without any pay upfront. “There had been so many writers and money spent on development,” Siegel says. “Melissa believed in it and was ready to do it.”

With the more heartfelt screenplay, Kennedy set up the project at DreamWorks and Disney. But it still wasn’t clear that Spielberg was the director until he went home one weekend with a stack of screenplays and came back with “The BFG” at the top of his pile. He wanted his new pal, “Bridge of Spies” actor Mark Rylance, to portray the benevolent lead.

“The BFG” premiered at the Cannes Film Festival last May, but Siegel got an early look at a screening with Dahl’s daughter Lucy. “At the end of the screening, Lucy turned to me with tears running down her face, telling me she felt like she had just spent the last two hours with her father,” he says. “We were both so floored by what we had seen that we hugged the first person we next met, who was the projectionist. The family all loved this film.”