You need more than that, you need legal basis and resources to be able to load up the crazy homeless person into a van and get them committed out of sight to an institution.
Homelessness isn't in itself a mental condition, although it can lead to or be caused by it. Public healthcare can help people who are homeless maintain their sanity and health, which can get them back on their feet. It may even stop them from becoming homeless in the first place. It also gives both the individual, care services, and authorities all a point of contact to try and make sure they're being taken care of.
European countries aren't dealing with these people by stuffing them in asylums; they have public housing programs, free healthcare, community support programs, health-workers and social-workers doing at-home visits, day-centres, and lots of other schemes to help.
Or you need an economic environment that doesn't drive people to become "crazy" and homeless.