You can return home to make the visa application and this will be indicated on the CAS. We will require evidence that you have returned home in the form of airline tickets / boarding passes or entry ...
In the 21st century, it is surprising that Portugal, a country eager to attract international investors, appears to still maintain a bureaucratic system that deters rather than invites.