In the 50 years since the assassination of John F. Kennedy, an entire genre of movies and miniseries has emerged about the Camelot years. But scant months before Kennedy’s death, Warner Bros. released a movie that may not be all that memorable on the screen, but certainly was remarkable in the making.

“PT 109,” an account of Kennedy’s World War II heroism in command of a motor torpedo boat that was rammed by a Japanese destroyer, marked the first time a major studio, in this case Warner Bros., had made a movie about a sitting President. The White House, well aware of the film’s potential impact — particularly since it was to be released in the year leading up to Kennedy’s reelection campaign — secured approval over the script, the lead, and even tried to exert influence over its running time.

Not that the studio resisted. Jack Warner, personally supervising the project, wrote in his autobiography that they “worked so diligently to keep everything in good taste and avoid exploitation of the man in his high office.”

But the $6.5 million project, in Warner’s word, ultimately “missed.” With Cliff Robertson in the lead, the result was an entertaining picture that failed for a number of reasons to make the mark the studio thought it would.

It didn’t help that the production process was erratic.

Apparently without first consulting with Kennedy, the studio had announced a PT 109 project just weeks after the young President’s inauguration. Under pressure to gain cooperation from the White House and PT 109 survivors, the studio soon snapped up the rights to the authorized book on which the movie was to be based, Robert Donovan’s “PT 109: John F. Kennedy in World War II,” even before the tome was published later in 1961. The conditions the Kennedy family placed on their cooperation for the book also applied to the movie: Approval over the way the President was portrayed, according to historian Timothy Naftali, who is writing a book on Kennedy to be published by W.W. Norton & Co.

Surprisingly, it was a strain to find an actor to play JFK.

The president’s choice to portray him was Warren Beatty. Kennedy told Donovan the casting was his wife’s idea, and the author, serving as a kind of emissary, relayed the preference to the film’s producer, Bryan Foy, according to Naftali’s research.

Beatty, Naftali concludes, was the first person the studio went to, “because of Jackie.”

“That caused a sensation, an absolute sensation,” Donovan said in an oral history interview for the Kennedy library.

That’s because the up-and-coming star, given a portion of an early draft of the script, passed on the role, and was so vocal that the script didn’t hold up, he later told biographer Peter Biskind that Warner “essentially kicked me off the lot” for the snub.

Peter Fonda and Jeffrey Hunter (later the Captain of Enterprise in the “Star Trek” pilot) were among those tested, with reels sent back to the White House for review, according to Nicholas J. Cull, who authored an essay on the making of “PT 109” for “Hollywood and the American Historical Film” (2012, Palgrave Macmillan).

JFK chose Robertson, even though the actor was just six years his junior, meaning that the man who would portray the wartime heroics of the 26-year-old Jack Kennedy was in fact pushing 40. Nor did he resemble the president. But Kennedy, after watching an audition, concluded of Robertson, using military terms, “He wears his equipment on the same side of his pants as I do,” according to historian Richard Reeves.

The process of finding a director was even more tumultuous.

The first director Warner enlisted for the project, Raoul Walsh, was nixed after Kennedy screened Walsh’s comedy “Marines, Let’s Go!” at the White House, and hated it.

The White House did want a prestigious name at the helm. George Stevens Jr., then director of motion picture services for the United States Information Agency, recommended Fred Zinnemann or John Huston. The studio chose Lewis Milestone (“All Quiet on the Western Front” and other classics), but there were problems from the start. He haggled with Warner over the script — even resigning, only to be lured back — and ultimately was fired during production in July, 1962. The studio’s official reason, according to Variety: Satisfactory progress was not being made. It is still unclear as to exactly why Milestone was sacked. Naftali notes that Warner, concerned about pleasing the White House, was frustrated that Milestone was making significant changes to an approved script, while Cull writes that the director finally vented his frustrations to Newsweek, embarrassing the studio.

Very quickly, Leslie Martinson, a noted television director, was brought in to complete the picture. The onus on Martinson at the time was just to get the movie made, according to his wife, Connie. (Her husband is now 98). He did make changes to the script, she says, apparently not enough to stir White House misgivings. The Kennedy team was more concerned that the project had become too glowing a portrait, and therefore was not believable, she says.

Still, as Naftali notes, “It is hard to imagine a White House-sponsored feature film that would show a lot of presidential introspection.” Kennedy himself put notations in one script copy, Cull discovered in his research, making it clear the President had concerns over such things as mentions of his father’s influence over his career. Robertson recommended a series of changes to give his character more of a backstory, but those suggestions were rejected in favor of a movie that, far from a character study, is pretty much just another war movie. Reeves, in an essay on the picture, wrote that the “film’s dialogue sounds pretty corny today, but it gets to the truth of John F. Kennedy: The man had an iron will.”

The film grossed about $5.5 million at the worldwide box office, respectable for the time, but still far short of what the studio had expected.

According to Warner, Kennedy said the finished product was a “fine job.” He was pleased enough with Robertson’s performance that he invited the actor to the White House for a visit, and invited author Donovan for an evening to watch the film. But Beatty said the President told him, “you were right about that movie.”

Naftali notes Kennedy’s back became the ultimate critic: Too long a sit and it would get agitated. On a White House recording, Kennedy called ‘PT 109’ a “good product,” but worried about the 2 hour, 20 minute length. “It’s just a question of whether there’s too much of it,” the President determined.

Studios would embark on movies about sitting commanders-in-chief again — Oliver Stone’s ‘W.’ being a recent example — but White House cooperation is hardly a prerequisite. In today’s hyperpartisan era, it’s probably a liability.

‘PT 109” may have only helped reinforce the glowing portraits of JFK and his era that still endure, but it also had a bit part in another, more unexpected legacy. As a key scene was being shot on Warner Bros., making his first visit to a soundstage to watch was a 15-year-old Steven Spielberg.