Skip to content

Commit e01e8ff

Browse files
danoli3vdonnefort
andauthored
macOS make: APP_VERSION and APP_BUILD for the app's Info.plist (#8592)
Set APP_VERSION (CFBundleShortVersionString, shown in the About window) and APP_BUILD (CFBundleVersion) in a project's config.make or on the make command line; defaults 1.0 and 1. The version was hardcoded to 1.0, and CFBundleVersion was left as the literal ${CURRENT_PROJECT_VERSION}. Based on #3394. Co-authored-by: Vincent Donnefort <vdonnefort@gmail.com>
1 parent 7008a10 commit e01e8ff

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

‎libs/openFrameworksCompiled/project/macos/config.macos.default.mk‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ PLATFORM_FRAMEWORKS_SEARCH_PATHS = /System/Library/Frameworks
415415
################################################################################
416416
#PLATFORM_CC=
417417

418+
# app version (CFBundleShortVersionString, shown in the About window) and build
419+
# number (CFBundleVersion); set APP_VERSION / APP_BUILD in the project's config.make
420+
APP_VERSION ?= 1.0
421+
APP_BUILD ?= 1
422+
418423
afterplatform: $(TARGET_NAME)
419424
@rm -rf bin/$(BIN_NAME).app
420425
@mkdir -p bin/$(BIN_NAME).app
@@ -439,7 +444,8 @@ afterplatform: $(TARGET_NAME)
439444
@sed -i '' 's/\$${EXECUTABLE_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
440445
@sed -i '' 's/\$${TARGET_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
441446
@sed -i '' 's/\$${PRODUCT_BUNDLE_IDENTIFIER}/cc.openFrameworks.$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
442-
@sed -i '' 's/\$${MARKETING_VERSION}/1.0/g' bin/$(BIN_NAME).app/Contents/Info.plist
447+
@sed -i '' 's/\$${MARKETING_VERSION}/$(APP_VERSION)/g' bin/$(BIN_NAME).app/Contents/Info.plist
448+
@sed -i '' 's/\$${CURRENT_PROJECT_VERSION}/$(APP_BUILD)/g' bin/$(BIN_NAME).app/Contents/Info.plist
443449

444450
@echo TARGET=$(TARGET)
445451
@mv $(TARGET) bin/$(BIN_NAME).app/Contents/MacOS

‎libs/openFrameworksCompiled/project/osx/config.osx.default.mk‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,11 @@ PLATFORM_FRAMEWORKS_SEARCH_PATHS = /System/Library/Frameworks
417417
################################################################################
418418
#PLATFORM_CC=
419419

420+
# app version (CFBundleShortVersionString, shown in the About window) and build
421+
# number (CFBundleVersion); set APP_VERSION / APP_BUILD in the project's config.make
422+
APP_VERSION ?= 1.0
423+
APP_BUILD ?= 1
424+
420425
afterplatform: $(TARGET_NAME)
421426
@rm -rf bin/$(BIN_NAME).app
422427
@mkdir -p bin/$(BIN_NAME).app
@@ -441,7 +446,8 @@ afterplatform: $(TARGET_NAME)
441446
@sed -i '' 's/\$${EXECUTABLE_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
442447
@sed -i '' 's/\$${TARGET_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
443448
@sed -i '' 's/\$${PRODUCT_BUNDLE_IDENTIFIER}/cc.openFrameworks.$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
444-
@sed -i '' 's/\$${MARKETING_VERSION}/1.0/g' bin/$(BIN_NAME).app/Contents/Info.plist
449+
@sed -i '' 's/\$${MARKETING_VERSION}/$(APP_VERSION)/g' bin/$(BIN_NAME).app/Contents/Info.plist
450+
@sed -i '' 's/\$${CURRENT_PROJECT_VERSION}/$(APP_BUILD)/g' bin/$(BIN_NAME).app/Contents/Info.plist
445451

446452
@echo TARGET=$(TARGET)
447453
@mv $(TARGET) bin/$(BIN_NAME).app/Contents/MacOS

‎scripts/templates/macos/config.make‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
################################################################################
1111
# OF_ROOT = ../../..
1212

13+
################################################################################
14+
# APP VERSION
15+
# The app's version, shown in the macOS About window (CFBundleShortVersionString),
16+
# and its build number (CFBundleVersion).
17+
#
18+
# (default) APP_VERSION = 1.0
19+
# (default) APP_BUILD = 1
20+
################################################################################
21+
# APP_VERSION = 1.0
22+
# APP_BUILD = 1
23+
1324
################################################################################
1425
# PROJECT ROOT
1526
# The location of the project - a starting place for searching for files

‎scripts/templates/osx/config.make‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
################################################################################
1111
# OF_ROOT = ../../..
1212

13+
################################################################################
14+
# APP VERSION
15+
# The app's version, shown in the macOS About window (CFBundleShortVersionString),
16+
# and its build number (CFBundleVersion).
17+
#
18+
# (default) APP_VERSION = 1.0
19+
# (default) APP_BUILD = 1
20+
################################################################################
21+
# APP_VERSION = 1.0
22+
# APP_BUILD = 1
23+
1324
################################################################################
1425
# PROJECT ROOT
1526
# The location of the project - a starting place for searching for files

0 commit comments

Comments
 (0)