The New York Knicks have reached an agreement in principle on a deal with Scott Perry to make him the franchise’s new general manager, league sources told ESPN.

But consummation of the hiring is pending the Knicks and Sacramento Kings arriving at terms on compensation, league sources said. New York and Sacramento have been wrangling over a financial arrangement to allow Perry to accept a promotion with New York, according to the sources.

Perry is the Kings’ vice president of basketball operations. The Kings granted the Knicks permission to meet with Perry, and the two sides sat down in New York on Thursday, league sources said.

Perry would report to Steve Mills, who will be elevated to Knicks president, sources said. Phil Jackson was dismissed as president of basketball operations shortly before the free-agency period.

While Mills will hold ultimate authority in the front office, Perry will be afforded tremendous freedom to operate as he chooses, league sources said. He will be the day-to-day voice running the basketball side.

New York has been searching for a GM who won’t push for an overhaul of the front-office staff, league sources said, as well as an executive who can coexist with Mills, who will have ultimate authority.

Days after Perry was dismissed as the Orlando Magic‘s assistant GM in April, the Kings hired him as the front office’s No. 2 to GM Vlade Divac. Perry played a part in selecting Kentucky point guard De’Aaron Fox with the No. 5 overall pick and making a draft-day trade to move back and draft twice more in the first round, selecting North Carolina’s Justin Jackson and Duke’s Harry Giles.

In free agency, the Kings signed veterans George Hill, Vince Carter and Zach Randolph.

Perry has a front-office history that includes stops in Seattle, Oklahoma City, Detroit, Orlando and Sacramento. He was part of helping GM Joe Dumars build an NBA champion and perennial contender with the Pistons.

On the Knicks front, former Cleveland Cavaliers general manager David Griffin pulled his name out of the front-office search last week, a source told The Undefeated’s Marc J. Spears.

Sources said the Knicks and Griffin were at odds over Griffin not having full authority on basketball decisions and over his preference to bring in his own staff. No formal contract offer was made.

Since parting ways with Jackson, the Knicks, under Mills, made the decision to sign Atlanta Hawks guard Tim Hardaway Jr. to a four-year, $71 million contract, a move that has been met with shock inside and outside the organization. The club wants to make a commitment to going young, transforming the roster to players in the 25-and-younger range.

New York says it wants to build around 7-foot-3 Kristaps Porzingis and continues to say it wants to move 10-time All-Star Carmelo Anthony in a trade. Anthony is willing to waive his no-trade clause for Houston and Cleveland now, league sources said.

The Knicks and Rockets have expanded the scope of a possible Anthony trade to include four-team scenarios, league sources told ESPN.

No deal was imminent Wednesday, but the Knicks and Rockets remain confident that they have a willing third-team trade partner, the sources said. The fourth team was needed to move a particular player contract that neither the Knicks nor Rockets could or would accept in the deal, league sources said.

Anthony, 33, has two years and $54 million left on his contract. The complexity of including multiple teams and assets in a deal creates time-consuming challenges, and there’s no guarantee that a deal can be reached.