Skip to content

Commit

Permalink
Add a verbatim copy of CMake's default MacOSXBundleInfo.plist.in
Browse files Browse the repository at this point in the history
We'll customise it next (ie for issue #9).
  • Loading branch information
pcolby committed Aug 6, 2023
1 parent 2f8e757 commit 0524086
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set(DokitCliSources
)

if(${CMAKE_VERSION} VERSION_LESS "3.12.0")
add_executable(cli MACOSX_BUNDLE main.cpp ${DokitCliSources})
add_executable(cli main.cpp ${DokitCliSources})
else()
# We put all but main.cpp into a shared 'object' library so
# our app unit tests can link against the same binary objects.
Expand All @@ -45,13 +45,22 @@ else()
PRIVATE Qt${QT_VERSION_MAJOR}::Core
PRIVATE Qt${QT_VERSION_MAJOR}::Bluetooth)

add_executable(cli MACOSX_BUNDLE main.cpp)
add_executable(cli main.cpp)

target_link_libraries(cli PRIVATE cli-lib)
endif()

set_target_properties(cli PROPERTIES OUTPUT_NAME dokit)

# Add a custom Info.plist file to the app bundle.
if(APPLE)
set_target_properties(
cli
PROPERTIES
MACOSX_BUNDLE true
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in)
endif()

# Only include localisation for Qt6+ for now. We could support Qt5
# too, but we'd need to manually implement some of Qt6's CMake
# functions, which would be easier if we had a bespoke qrc file.
Expand Down
34 changes: 34 additions & 0 deletions src/cli/Info.plist.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
</dict>
</plist>

0 comments on commit 0524086

Please sign in to comment.