Got an Openframeworks app that relies on cpprestsdk, have installed cpprestsdk via brew on my Mac.
My App works correctly with cpprestsdk but when I go to run the app on another computer those libraries are not available.
How can I package them with the app so the app can be deployed on any Mac without installing via brew?
your question is good and not straightforward to answer, as any .dylib you provide your end user with will be tied to a number of parameters which where part of its compilation process. important such parameters are target architecture(s) and the OS version.
in the case of a brew-provided .dylib you have little explicit control over these. brew tries to do the right thing™ for you, which means scanning your system then sometimes compiling locally, otherwise downloading a precompiled package that matches your configuration – the resultant binary that you end up with may not run on “any Mac”. so packaging that is not necessarily going to work.
of the OF side it boils down to creating an addon (source- or binary-based), or adding a build script that copies the desired library and rewrites the links paths (the Xcode template contains the remnants of such a process that used to be required for fmod – you can do something like that with other libs). but you’re still responsible to make sure the .dylib you have on hand will run on “any Mac” which may not be easy to guarantee (and not specifically an OF issue). but at least, the app will run on “any Mac” that matches your own system parameters.