The story of "The Cat Returns" was inspired by some of the scenes shown in "Whisper of the Heart" namely the ones depicting the fantasy story the main character wrote. This story was later realized as a manga by Aoi Hiiragi who did the manga "Whisper of the Heart" was based on and then turned into a movie.
In 1995, Studio Ghibli released a film entitled Whisper of the Heart, based on a manga by Aoi Hiiragi, of a girl writing a fantasy novel. Although the girl's life had no magical elements, the film featured short fantasy scenes depicting what the girl was writing of the Baron, a character of her novel, which were so popular that an indirect sequel was made, featuring the Baron and another girl, a high school student, named Haru. Muta also returned. The Cat Returns began as the "Cat Project" in 1999. Studio Ghibli received a request from a Japanese theme park to create a 20-minute short starring cats. Hayao Miyazaki wanted three key elements to feature in the short — these were the Baron, Muta (Moon) and a mysterious antique shop. Hiiragi was commissioned to create the manga equivalent of the short, which is called Baron: The Cat Returns (バロン 猫の男爵 Baron: Neko no Danshaku, lit. Baron: The Cat Baron) and is published in English by Viz Media. The theme park later canceled the project. Miyazaki then took the existing work done by the "Cat Project" and used it as testing for future Ghibli directors — the short was now to be 45 minutes long. Responsibility was given to Hiroyuki Morita, who had started as an animator in 1999 for the film My Neighbors the Yamadas. Over a nine-month period he translated Hiiragi's Baron story into 525 pages of storyboards for what was to be The Cat Returns. Miyazaki and Toshio Suzuki decided to produce a feature-length film based entirely on Morita's storyboard; this was partly because Haru, the main character, had a "believable feel to her". It became the second theatrical (third overall) Studio Ghibli feature to be directed by someone other than Miyazaki or Takahata.
Source