From 61ecab34c4bd0ff3ac208ecd09de00c7cf986d87 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Mon, 2 Nov 2026 00:12:02 +1100 Subject: [PATCH] APP_BUNDLE_ID in config.make / CMake for the macOS bundle identifier --- libs/openFrameworksCompiled/project/CMake/README.md | 3 ++- .../project/CMake/platform/apple.cmake | 11 ++++++++--- .../project/macos/config.macos.default.mk | 4 +++- .../project/osx/config.osx.default.mk | 4 +++- scripts/templates/macos/config.make | 9 +++++++++ scripts/templates/osx/config.make | 9 +++++++++ 6 files changed, 34 insertions(+), 6 deletions(-) diff --git a/libs/openFrameworksCompiled/project/CMake/README.md b/libs/openFrameworksCompiled/project/CMake/README.md index 50a9bebf7bc..e95f91da734 100644 --- a/libs/openFrameworksCompiled/project/CMake/README.md +++ b/libs/openFrameworksCompiled/project/CMake/README.md @@ -126,6 +126,7 @@ makefiles' `config.make` options. | `OF_WEBGL_VERSION` | `2` | `1` for a WebGL 1 build | | `APP_VERSION` | `project()` version, else `1.0` | app version (macOS / iOS / tvOS `CFBundleShortVersionString`), same as the makefiles' `config.make` | | `APP_BUILD` | `1` | build number (`CFBundleVersion`) | +| `APP_BUNDLE_ID` | `cc.openFrameworks.` | bundle identifier (`CFBundleIdentifier`), same as the makefiles' `config.make` | | `OF_APPLE_DEVELOPMENT_TEAM` | | signing team for iOS / tvOS devices | ## Addons @@ -149,7 +150,7 @@ platform (an existing `CMakeLists.txt` is kept) and writes the addons to `addons projectGenerator -o"" -p"linux64" -t"cmake" apps/myApps/myApp # -p vs, osx, emscripten, ... ``` -It also reads `APP_VERSION` / `APP_BUILD` and `PROJECT_EMSCRIPTEN_WASM` back from the +It also reads `APP_VERSION` / `APP_BUILD` / `APP_BUNDLE_ID` and `PROJECT_EMSCRIPTEN_WASM` back from the `CMakeLists.txt` (projectGenerator#664, #670). The projectGenerator in `apps/projectGenerator` on master (0.115.0) has it. diff --git a/libs/openFrameworksCompiled/project/CMake/platform/apple.cmake b/libs/openFrameworksCompiled/project/CMake/platform/apple.cmake index d17fa18c76d..2f8942638e1 100644 --- a/libs/openFrameworksCompiled/project/CMake/platform/apple.cmake +++ b/libs/openFrameworksCompiled/project/CMake/platform/apple.cmake @@ -45,9 +45,14 @@ function(of_apple_info_plist target project_plist fallback_plist) else() set(build 1) endif() - string(MAKE_C_IDENTIFIER "${name}" bundle_name) - string(REPLACE "_" "-" bundle_name "${bundle_name}") - set(identifier "cc.openFrameworks.${bundle_name}") + # APP_BUNDLE_ID, like the makefiles' config.make + if(APP_BUNDLE_ID) + set(identifier "${APP_BUNDLE_ID}") + else() + string(MAKE_C_IDENTIFIER "${name}" bundle_name) + string(REPLACE "_" "-" bundle_name "${bundle_name}") + set(identifier "cc.openFrameworks.${bundle_name}") + endif() foreach(pair "DEVELOPMENT_LANGUAGE=English" "ICON_NAME=of.icns" diff --git a/libs/openFrameworksCompiled/project/macos/config.macos.default.mk b/libs/openFrameworksCompiled/project/macos/config.macos.default.mk index 9fffdca4dfb..0a57353af1a 100644 --- a/libs/openFrameworksCompiled/project/macos/config.macos.default.mk +++ b/libs/openFrameworksCompiled/project/macos/config.macos.default.mk @@ -419,6 +419,8 @@ PLATFORM_FRAMEWORKS_SEARCH_PATHS = /System/Library/Frameworks # number (CFBundleVersion); set APP_VERSION / APP_BUILD in the project's config.make APP_VERSION ?= 1.0 APP_BUILD ?= 1 +# bundle id (CFBundleIdentifier); set APP_BUNDLE_ID in the project's config.make +APP_BUNDLE_ID ?= cc.openFrameworks.$(BIN_NAME) afterplatform: $(TARGET_NAME) @rm -rf bin/$(BIN_NAME).app @@ -443,7 +445,7 @@ afterplatform: $(TARGET_NAME) @sed -i '' 's/\$${DEVELOPMENT_LANGUAGE}/English/g' bin/$(BIN_NAME).app/Contents/Info.plist @sed -i '' 's/\$${EXECUTABLE_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist @sed -i '' 's/\$${TARGET_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist - @sed -i '' 's/\$${PRODUCT_BUNDLE_IDENTIFIER}/cc.openFrameworks.$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist + @sed -i '' 's/\$${PRODUCT_BUNDLE_IDENTIFIER}/$(APP_BUNDLE_ID)/g' bin/$(BIN_NAME).app/Contents/Info.plist @sed -i '' 's/\$${MARKETING_VERSION}/$(APP_VERSION)/g' bin/$(BIN_NAME).app/Contents/Info.plist @sed -i '' 's/\$${CURRENT_PROJECT_VERSION}/$(APP_BUILD)/g' bin/$(BIN_NAME).app/Contents/Info.plist diff --git a/libs/openFrameworksCompiled/project/osx/config.osx.default.mk b/libs/openFrameworksCompiled/project/osx/config.osx.default.mk index 2c93c547e1a..ffc52350395 100644 --- a/libs/openFrameworksCompiled/project/osx/config.osx.default.mk +++ b/libs/openFrameworksCompiled/project/osx/config.osx.default.mk @@ -421,6 +421,8 @@ PLATFORM_FRAMEWORKS_SEARCH_PATHS = /System/Library/Frameworks # number (CFBundleVersion); set APP_VERSION / APP_BUILD in the project's config.make APP_VERSION ?= 1.0 APP_BUILD ?= 1 +# bundle id (CFBundleIdentifier); set APP_BUNDLE_ID in the project's config.make +APP_BUNDLE_ID ?= cc.openFrameworks.$(BIN_NAME) afterplatform: $(TARGET_NAME) @rm -rf bin/$(BIN_NAME).app @@ -445,7 +447,7 @@ afterplatform: $(TARGET_NAME) @sed -i '' 's/\$${DEVELOPMENT_LANGUAGE}/English/g' bin/$(BIN_NAME).app/Contents/Info.plist @sed -i '' 's/\$${EXECUTABLE_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist @sed -i '' 's/\$${TARGET_NAME}/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist - @sed -i '' 's/\$${PRODUCT_BUNDLE_IDENTIFIER}/cc.openFrameworks.$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist + @sed -i '' 's/\$${PRODUCT_BUNDLE_IDENTIFIER}/$(APP_BUNDLE_ID)/g' bin/$(BIN_NAME).app/Contents/Info.plist @sed -i '' 's/\$${MARKETING_VERSION}/$(APP_VERSION)/g' bin/$(BIN_NAME).app/Contents/Info.plist @sed -i '' 's/\$${CURRENT_PROJECT_VERSION}/$(APP_BUILD)/g' bin/$(BIN_NAME).app/Contents/Info.plist diff --git a/scripts/templates/macos/config.make b/scripts/templates/macos/config.make index 9dd94bb5093..590ff85fbae 100644 --- a/scripts/templates/macos/config.make +++ b/scripts/templates/macos/config.make @@ -21,6 +21,15 @@ # APP_VERSION = 1.0 # APP_BUILD = 1 +################################################################################ +# APP BUNDLE ID +# The app's bundle identifier (CFBundleIdentifier), eg com.example.myApp. +# The projectGenerator also sets it in the Xcode project and keeps it on update. +# +# (default) APP_BUNDLE_ID = cc.openFrameworks. +################################################################################ +# APP_BUNDLE_ID = com.example.myApp + ################################################################################ # PROJECT ROOT # The location of the project - a starting place for searching for files diff --git a/scripts/templates/osx/config.make b/scripts/templates/osx/config.make index 8ccbf30d573..3cc1bf60c86 100644 --- a/scripts/templates/osx/config.make +++ b/scripts/templates/osx/config.make @@ -21,6 +21,15 @@ # APP_VERSION = 1.0 # APP_BUILD = 1 +################################################################################ +# APP BUNDLE ID +# The app's bundle identifier (CFBundleIdentifier), eg com.example.myApp. +# The projectGenerator also sets it in the Xcode project and keeps it on update. +# +# (default) APP_BUNDLE_ID = cc.openFrameworks. +################################################################################ +# APP_BUNDLE_ID = com.example.myApp + ################################################################################ # PROJECT ROOT # The location of the project - a starting place for searching for files