how to package a project?

This seems like it should be obvious but I am struggling.

I have recently made a game with c++ and SDL2 in vscode mac compiling with clang.

right now I have a bunch of files: an executable, a load of pngs, some wav files as well as a ttf font all in a directory together. How do I go about packaging all of this together in such a way that I can send it to my friends for them to run on their own osx machines so that I can show off... ;)

I'm assuming I need to include the .dylib files for SDL2, SD2L_img and SD2L_ttf somewhere as well?

Thanks in advance!
Last edited on
I haven't done anything on a Mac for a little while, but as I recall, the whole Application and it's assets live in /Applications/<app_name>

It's equivalent to apps installed under /opt on Unix.

The installer just packages the whole directory.

Dependent libraries, like sdl2, have their own packages. Those can be installed separately, if not already included in your app.
thanks for the reply!
How do I include the SDL packages in my app, Would I need to add the source code to my working directory before compiling rather than linking to the .dylib files?

should I be using a packager like http://s.sudre.free.fr/Software/Packages/about.html or is that unnecessary.


Last edited on
Mac applications are in a folder system called a 'bundle' that looks like this:

MyApp.app/
----Contents/
--------Info.plist
--------MacOS/
------------MyApp
--------Resources/

Where each component with a back slash is a folder. The executable is in the MacOS folder ('MyApp' above). You could create a bundle by setting up your own folders on the Mac and initially leaving the '.app' extension off of the top folder name. After you have inserted all the folder contents, ie executable, plist, resources etc add the '.app' extension to the top folder and you will have a double clickable app which you can pass around to your friends with Macs (if the gatekeeper allows it). Apple is now requiring its apps to be code signed either in Xcode or by command line and may hinder sharing. You could try it and see if it's still allowed without signing.
I will defintitely have a go at this thanks!
Topic archived. No new replies allowed.