Skip to content

Commit 2fd555f

Browse files
committed
App: modify CMakeLists to CMAKE_INSTALL_DATADIR
1 parent 43401f0 commit 2fd555f

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

.github/workflows/android.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ jobs:
224224
-DCMAKE_VERBOSE_MAKEFILE=ON \
225225
-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake \
226226
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
227+
-DCMAKE_MAKE_PROGRAM=ninja \
227228
-DVCPKG_VERBOSE=ON \
228229
-DVCPKG_TRACE_FIND_PACKAGE=ON \
229230
-DVCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}} \

App/Client/CMakeLists.txt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ if(WIN32)
128128
COMPONENT Application)
129129
elseif(APPLE)
130130
if(WITH_MACOSX_BUNDLE)
131-
# 设置 bundle 属性 (如果是 GUI 应用)
132-
# See: https://developer.apple.com/documentation/bundleresources/information-property-list
133-
set_target_properties(${PROJECT_NAME} PROPERTIES
134-
MACOSX_BUNDLE_GUI_IDENTIFIER "${APP_ID}"
135-
MACOSX_BUNDLE_ICON_FILE "${APP_ID}.icns"
136-
MACOSX_BUNDLE_BUNDLE_NAME "RabbitRemoteControl"
137-
MACOSX_BUNDLE_BUNDLE_VERSION "${RabbitRemoteControl_VERSION}"
138-
MACOSX_BUNDLE_SHORT_VERSION_STRING "${RabbitRemoteControl_VERSION}"
139-
)
131+
# 设置 bundle 属性 (如果是 GUI 应用)
132+
# See: https://developer.apple.com/documentation/bundleresources/information-property-list
133+
set_target_properties(${PROJECT_NAME} PROPERTIES
134+
MACOSX_BUNDLE_GUI_IDENTIFIER "${APP_ID}"
135+
MACOSX_BUNDLE_ICON_FILE "${APP_ID}.icns"
136+
MACOSX_BUNDLE_BUNDLE_NAME "RabbitRemoteControl"
137+
MACOSX_BUNDLE_BUNDLE_VERSION "${RabbitRemoteControl_VERSION}"
138+
MACOSX_BUNDLE_SHORT_VERSION_STRING "${RabbitRemoteControl_VERSION}"
139+
)
140140
else()
141141
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Resource/App.Info.plist
142142
${CMAKE_CURRENT_BINARY_DIR}/Info.plist
@@ -149,25 +149,24 @@ elseif(UNIX AND NOT ANDROID)
149149
configure_file(${CMAKE_SOURCE_DIR}/share/applications/${APP_ID}.desktop.in
150150
${CMAKE_BINARY_DIR}/${APP_ID}.desktop)
151151
INSTALL(FILES ${CMAKE_BINARY_DIR}/${APP_ID}.desktop
152-
DESTINATION share/applications
152+
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
153153
COMPONENT Application)
154154
# INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/share/applications/RabbitRemoteControl.sh
155155
# DESTINATION ${CMAKE_INSTALL_BINDIR}
156156
# COMPONENT Application)
157-
# Icon path
157+
# Icon path: http://freedesktop.org/wiki/Standards/icon-theme-spec
158158
# The freedesktop.org standard specifies in which order and directories programs should look for icons:
159159
#
160160
# $HOME/.icons (for backwards compatibility)
161161
# $XDG_DATA_DIRS/icons
162162
# /usr/share/pixmaps
163163
#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resource/icons/rabbit-green/svg/app.svg
164-
# DESTINATION share/pixmaps
164+
# DESTINATION ${CMAKE_INSTALL_DATADIR}/pixmaps
165165
# COMPONENT Application
166166
# RENAME ${APP_ID}.svg)
167-
168167
# Flatpak: https://docs.flatpak.org/en/latest/conventions.html#application-icons
169168
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resource/icons/rabbit-green/svg/app.svg
170-
DESTINATION share/icons/hicolor/scalable/apps
169+
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps
171170
COMPONENT Application
172171
RENAME ${APP_ID}.svg)
173172

Script/install_appimage.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ if [ $INSTALL_DIR != $ROOT_DIR ]; then
9595
fi
9696

9797
# 修改执行文件
98-
sed -i "s#Exec=.*#Exec=${APPIMAGE_FILE}#g" $INSTALL_DIR/$APP_ID.desktop
98+
sed -i "s#Exec=.*#Exec=$INSTALL_DIR/${APPIMAGE_FILE}#g" $INSTALL_DIR/$APP_ID.desktop
9999
# 修改路径
100100
sed -i "s#Path=.*#Path=${INSTALL_DIR}#g" $INSTALL_DIR/$APP_ID.desktop
101101
if [ ! -f $DESKTOP_FILE ]; then
102102
CREATE_DESKTOP_FILE=1
103103
ln -s ${INSTALL_DIR}/$APP_ID.desktop $DESKTOP_FILE
104-
# ICON 使用绝对路径。因为已修改了 Path,所以此处可以不用修改
105-
#sed -i "s#^Icon=.*#Icon=$INSTALL_DIR/$APP_ID.svg#" $INSTALL_DIR/$APP_ID.desktop
104+
# ICON 使用绝对路径
105+
sed -i "s#^Icon=.*#Icon=$INSTALL_DIR/$APP_ID.svg#" $INSTALL_DIR/$APP_ID.desktop
106106
fi
107107

108108
echo "echo \"Uninstall \\\"Rabbit Remote Control\\\" AppImage from \\\"$(dirname $(readlink -f $DESKTOP_FILE))\\\"\"" > $INSTALL_DIR/uninstall.sh

0 commit comments

Comments
 (0)