I have a multi platform application that runs on Windows, Linux, Android and Mac. It is compiled with g++ on all platforms.
For windows, I created an installer and g
Based on your description, you're building what is a unix-style executable. On OS X, those will always launch inside of a terminal window. The choices that you have on OS X are:
In most cases, you can create a wrapper for a unix-style executable by creating the appropriate Bundle using the instructions from Apple's Bundle Programming Guide (skip over the iOS stuff and look at the Mac bundle information).
The basic directory structure is:
MyApp.app/
Contents/
Info.plist
MacOS/
executable
Resources/
MyApp.icns
Your unmodified executable can go in the MacOS
directory, and you'll need to set up the following keys in the Info.plist
using a plist editing tool or editor:
CFBundleIdentifier
- the id of your app in reverse-dns notation (com.mycompany.myapp
)CFBundleDisplayName
- the name of your app in human-readable form (MyApp
)CFBundleName
- the short name of the app (usually the same as your app and executable name)CFBundleVersion
- your version # in X.Y[.Z] formCFBundlePackageType
- the package type, which should be APPL
for applicationsCFBundleExecutable
- the name of your executableCFBundleSignature
- old-school Apple signature (4 character code that should theoretically be registered with apple)A minimal plist would look like this: CFBundleDisplayName MyApp CFBundleExecutable a.out CFBundleIdentifier com.mycompany.myapp CFBundleName MyApp CFBundlePackageType APPL CFBundleSignature FOOZ CFBundleVersion 1.0
(The above example uses a.out
as the executable, which would be located in MyApp.app/Contents/MacOS/a.out
)
The icon resources can be left out if you don't care about the icon, and the default application icon will be used.