macos bundle fix

This commit is contained in:
Vadim Grigoruk 2018-09-04 18:23:27 +03:00
parent 9889fd2cdd
commit a6d0408f1e
5 changed files with 34 additions and 37 deletions

View File

@ -428,6 +428,10 @@ foreach(TIC80_OUTPUT ${TIC80_OUTPUTS})
if(WIN32)
set(TIC80_SRC ${TIC80_SRC} build/windows/tic80.rc)
add_executable(${TIC80_OUTPUT} WIN32 ${TIC80_SRC})
elseif(APPLE)
add_executable(${TIC80_OUTPUT} MACOSX_BUNDLE ${TIC80_SRC} build/macosx/tic80.icns)
set_source_files_properties(build/macosx/tic80.icns PROPERTIES MACOSX_PACKAGE_LOCATION RESOURCES)
set_target_properties(${TIC80_OUTPUT} PROPERTIES MACOSX_BUNDLE_INFO_PLIST build/macosx/${TIC80_OUTPUT}.plist)
else()
add_executable(${TIC80_OUTPUT} ${TIC80_SRC})
endif()

View File

@ -1,37 +0,0 @@
APPNAME=tic80
APPBUNDLE=$(APPNAME).app
APPBUNDLECONTENTS=$(APPBUNDLE)/Contents
APPBUNDLEEXE=$(APPBUNDLECONTENTS)/MacOS
APPBUNDLEICON=$(APPBUNDLECONTENTS)/Resources
all: dmg
dmg: appbundle
hdiutil create -volname $(APPNAME) -srcfolder $(APPNAME).app -ov -format UDZO $(APPNAME).dmg
appbundle: $(APPNAME).icns
rm -rf $(APPBUNDLE)
mkdir $(APPBUNDLE)
mkdir $(APPBUNDLE)/Contents
mkdir $(APPBUNDLE)/Contents/MacOS
mkdir $(APPBUNDLE)/Contents/Resources
cp Info.plist $(APPBUNDLECONTENTS)/
echo "APPL????" > $(APPBUNDLECONTENTS)/PkgInfo
cp $(APPNAME).icns $(APPBUNDLEICON)/
cp ../../bin/$(APPNAME) $(APPBUNDLEEXE)/$(APPNAME)
$(APPNAME).icns: $(APPNAME)Icon.png
rm -rf $(APPNAME).iconset
mkdir $(APPNAME).iconset
sips -z 16 16 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_16x16.png
sips -z 32 32 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_16x16@2x.png
sips -z 32 32 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_32x32.png
sips -z 64 64 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_32x32@2x.png
sips -z 128 128 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_128x128.png
sips -z 256 256 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_128x128@2x.png
sips -z 256 256 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_256x256.png
sips -z 512 512 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_256x256@2x.png
sips -z 512 512 $(APPNAME)Icon.png --out $(APPNAME).iconset/icon_512x512.png
cp $(APPNAME)Icon.png $(APPNAME).iconset/icon_512x512@2x.png
iconutil -c icns -o $(APPNAME).icns $(APPNAME).iconset
rm -r $(APPNAME).iconset

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>TIC-80 Pro</string>
<key>CFBundleExecutable</key>
<string>tic80pro</string>
<key>CFBundleIconFile</key>
<string>tic80.icns</string>
<key>CFBundleIdentifier</key>
<string>com.nesbox.tic</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>TIC-80 Pro</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.70.6</string>
<key>CFBundleVersion</key>
<string>0.70.6</string>
<key>NSHumanReadableCopyright</key>
<string>http://tic.computer © 2017</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>