Make xcode detection a bit more robust and configurable