build: Use custom plist template

Customize the cmake used template so we can generate the plist
using configure file this will allow us to add several additional
keys we would not be able to otherwise add to our plist file
"
This commit is contained in:
sithlord48 2025-01-08 15:49:04 -05:00 committed by Nick Bolton
parent 1dadc2ddf4
commit 4b6d0059c5
2 changed files with 51 additions and 9 deletions

View file

@ -1,4 +1,5 @@
# Deskflow -- mouse and keyboard sharing utility
# Copyright (C) 2024 - 2025 Chris Rizzitello <sithlord48@gmail.com>
# Copyright (C) 2024 Symless Ltd.
#
# This package is free software; you can redistribute it and/or
@ -19,6 +20,21 @@ else()
set(target deskflow)
endif()
#setup our bundle plist file
set(BUNDLE_EXECUTABLE_NAME "${target}")
set(BUNDLE_BUNDLE_NAME "${target}")
set(BUNDLE_DISPLAY_NAME "${target}")
set(BUNDLE_GUI_IDENTIFIER "org.deskflow.deskflow")
set(BUNDLE_ICON_FILE ${target}.icns)
set(BUNDLE_INFO_STRING "${CMAKE_PROJECT_DESCRIPTION}")
set(BUNDLE_COPYRIGHT "© 2024 Deskflow Developers")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/../res/deskflow.plist.in
${CMAKE_CURRENT_BINARY_DIR}/deskflow.plist
@ONLY
)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
@ -83,15 +99,7 @@ if(WIN32)
elseif(APPLE)
set_target_properties(${target} PROPERTIES
INSTALL_RPATH "@loader_path/../Libraries;@loader_path/../Frameworks"
MACOSX_BUNDLE_BUNDLE_NAME "Deskflow"
MACOSX_BUNDLE_DISPLAY_NAME "Deskflow"
MACOSX_BUNDLE_GUI_IDENTIFIER "org.deskflow.deskflow"
MACOSX_BUNDLE_ICON_FILE Deskflow.icns
MACOSX_BUNDLE_INFO_STRING "${CMAKE_PROJECT_DESCRIPTION}"
MACOSX_BUNDLE_COPYRIGHT "© 2024 Deskflow Developers"
MACOSX_BUNDLE_BUNDLE_VERSION ${CMAKE_PROJECT_VERSION}
MACOSX_BUNDLE_LONG_VERSION_STRING ${CMAKE_PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${CMAKE_PROJECT_VERSION}
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/deskflow.plist"
)
install(TARGETS ${target} BUNDLE DESTINATION .)
else()

View file

@ -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>@BUNDLE_EXECUTABLE_NAME@</string>
<key>CFBundleGetInfoString</key>
<string>@BUNDLE_INFO_STRING@</string>
<key>CFBundleIconFile</key>
<string>@BUNDLE_ICON_FILE@</string>
<key>CFBundleIdentifier</key>
<string>@BUNDLE_GUI_IDENTIFIER@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleName</key>
<string>@BUNDLE_BUNDLE_NAME@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@CMAKE_PROJECT_VERSION@</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>@BUNDLE_COPYRIGHT@</string>
</dict>
</plist>