Create app bundle for macOS

remotes/origin/HEAD
Konstantinos Sideris 7 years ago
parent 9189782d3b
commit 9bfd51ceed
  1. 2
      .gitignore
  2. 40
      Makefile
  3. 8
      README.md
  4. 33
      dist/MacOS/nheko.app/Contents/Info.plist
  5. 0
      dist/MacOS/nheko.app/Contents/MacOS/.gitkeep
  6. BIN
      dist/MacOS/nheko.app/Contents/Resources/nheko.icns

2
.gitignore vendored

@ -75,3 +75,5 @@ Temporary Items
# Nix # Nix
result result
*.dmg
dist/MacOS/nheko.app/Contents/MacOS/nheko

@ -1,13 +1,18 @@
APP_NAME = nheko
MAC_DIST_DIR = dist/MacOS
APP_TEMPLATE = $(MAC_DIST_DIR)/Nheko.app
SRC := $(shell find include src -type f -type f \( -iname "*.cc" -o -iname "*.h" \)) SRC := $(shell find include src -type f -type f \( -iname "*.cc" -o -iname "*.h" \))
# Linux specific helpers # Linux specific helpers
debug: debug:
@cmake -DBUILD_TESTS=OFF -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Debug @cmake -DBUILD_TESTS=OFF -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Debug
@cmake --build build @cmake --build build
release-debug: release-debug:
@cmake -DBUILD_TESTS=OFF -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo @cmake -DBUILD_TESTS=OFF -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo
@cmake --build build @cmake --build build
test: test:
@ -15,24 +20,19 @@ test:
@cmake --build build @cmake --build build
@cd build && GTEST_COLOR=1 ctest --verbose @cd build && GTEST_COLOR=1 ctest --verbose
# MacOS specific helpers app: release-debug $(APP_TEMPLATE)
mdebug: @cp -fp ./build/$(APP_NAME) $(APP_TEMPLATE)/Contents/MacOS
@cmake -DBUILD_TESTS=OFF \ @echo "Created '$(APP_NAME).app' in '$(APP_TEMPLATE)'"
-H. \
-GNinja \
-Bbuild \
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \
-DCMAKE_BUILD_TYPE=Debug
@cmake --build build
mrelease: app-install: app
@cmake -DBUILD_TESTS=OFF \ cp -rf $(APP_TEMPLATE) /Applications/Nheko.app
-H. \
-GNinja \ dmg: app
-Bbuild \ hdiutil create $(MAC_DIST_DIR)/Nheko.dmg \
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \ -volname "$(APP_NAME)" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -fs HFS+ \
@cmake --build build -srcfolder $(MAC_DIST_DIR) \
-ov -format UDZO
run: run:
@./build/nheko @./build/nheko
@ -44,4 +44,4 @@ lint:
clean: clean:
rm -rf build rm -rf build
.PHONY: build .PHONY: build app dmg

@ -92,6 +92,14 @@ make -C build
The `nheko` binary will be located in the `build` directory. The `nheko` binary will be located in the `build` directory.
##### MacOS
You can create an app bundle with `make app`. The output will be located at
`dist/MacOS/Nheko.app` which you can be copied to `/Applications/Nheko.app`.
You can also create a disk image with `make dmg`. The output will be located at
`dist/MacOS/Nheko.dmg`
##### Nix ##### Nix
Download the repo as mentioned above and run Download the repo as mentioned above and run

@ -0,0 +1,33 @@
<?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>CFBundleDisplayName</key>
<string>Nheko</string>
<key>CFBundleExecutable</key>
<string>nheko</string>
<key>CFBundleIdentifier</key>
<string>nheko</string>
<key>CFBundleName</key>
<string>Nheko</string>
<key>CFBundleIconFile</key>
<string>nheko.icns</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>CFBundleVersion</key>
<string>0.1.0</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>NSHighResolutionCapable</key>
<true />
<key>NSMainNibFile</key>
<string></string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true />
</dict>
</plist>
Loading…
Cancel
Save