Eric McCormack has been cast as the lead in Fox’s “Studio City” pilot, Variety has learned.

The “Will & Grace” Emmy winner will star as a celebrity drug dealer in the hourlong drama, which has been described as a cross between “The O.C.” and “Shameless,” and hails from producers of the latter series, Krista Vernoff, Andrew Stearns and John Wells.

“Empire” director Sanaa Hamri is attached to direct.

The coming-of-age story, inspired by Vernoff’s real-life experiences, follows a young singer’s journey to stardom as she grows up living with her singer-songwriter father (McCormack), who happens to be a drug dealer to the stars and mixes his day job with his dreams of becoming a musician to “chaotic effect.”

Vernoff penned the pilot and will serve as an exec producer, along with Wells and Stearns. John Wells Productions, in association with Warner Bros. TV, will produce.

McCormack is represented by ICM, the Coronel Group and Harris Hartman of Sloane, Offer, Weber and Dern law firm