Yea that’s pretty much the only way. Mercy Ships is a major charity that does similar. And to the commenter who mentioned the trump foundation, it was charged with fraud, fined $2M, and dissolved. So probably not a great example.
My understanding is that there are actually very few restrictions on what kind of expenses charitable foundations can use their funds toward. The public’s attention was drawn to this because of media reporting on some of the more ludicrous outlays of the Trump Foundation.
https://en.m.wikipedia.org/wiki/Mercy_Ships