I don\'t know if this question has been asked, because searching finds results mostly about moving the libraries installation directory.
I have a globally installed comp
In addition to the above answer from Tomáš Votruba i had to append the = charachter on OSX. So the full command would be:
composer install -d=/home/someuser/myproject
My first post on SO so was unable to simply add this as a comment.