Skip to content

Commit

Permalink
Start macOS app bundle name with uppercase letter
Browse files Browse the repository at this point in the history
It's a convention on macOS that app bundle names start with an uppercase
letter. Also this aligns the app name with Windows and Linux.

Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
  • Loading branch information
Felix Weilbach committed Jun 8, 2021
1 parent d06998a commit d49818a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ set(SHAREDIR ${DATADIR})
# BUILD_OWNCLOUD_OSX_BUNDLE was not initialized OR set to true on OSX
if(APPLE AND (NOT DEFINED BUILD_OWNCLOUD_OSX_BUNDLE OR BUILD_OWNCLOUD_OSX_BUNDLE))
set(BUILD_OWNCLOUD_OSX_BUNDLE ON)
set(OWNCLOUD_OSX_BUNDLE "${APPLICATION_EXECUTABLE}.app")
set(LIB_INSTALL_DIR "${APPLICATION_EXECUTABLE}.app/Contents/MacOS")
set(BIN_INSTALL_DIR "${APPLICATION_EXECUTABLE}.app/Contents/MacOS")
set(OWNCLOUD_OSX_BUNDLE "${APPLICATION_NAME}.app")
set(LIB_INSTALL_DIR "${APPLICATION_NAME}.app/Contents/MacOS")
set(BIN_INSTALL_DIR "${APPLICATION_NAME}.app/Contents/MacOS")

# BUILD_OWNCLOUD_OSX_BUNDLE was disabled on OSX
elseif(APPLE AND NOT BUILD_OWNCLOUD_OSX_BUNDLE)
Expand Down
2 changes: 1 addition & 1 deletion admin/osx/macosx.pkgproj.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>@APPLICATION_EXECUTABLE@.app</string>
<string>@APPLICATION_NAME@.app</string>
<key>PATH_TYPE</key>
<integer>3</integer>
<key>PERMISSIONS</key>
Expand Down
30 changes: 13 additions & 17 deletions src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,20 @@ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
endif()

if(NOT BUILD_LIBRARIES_ONLY)
add_executable(${cmd_NAME} cmd.cpp)
set_target_properties(${cmd_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
add_executable(${cmd_NAME} cmd.cpp)

target_link_libraries(${cmd_NAME} cmdCore)
endif()
if(BUILD_OWNCLOUD_OSX_BUNDLE)
set_target_properties(${cmd_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS")
else()
set_target_properties(${cmd_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY})

# OSX: Copy nextcloudcmd to app bundle, src/gui will run macdeployqt
if(BUILD_OWNCLOUD_OSX_BUNDLE)
add_custom_command(TARGET ${cmd_NAME} POST_BUILD
COMMAND "cp"
"$<TARGET_FILE:${cmd_NAME}>"
"${BIN_OUTPUT_DIRECTORY}/${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS"
COMMENT "Copying nextcloudcmd..."
)
elseif(NOT BUILD_LIBRARIES_ONLY)
install(TARGETS ${cmd_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

target_link_libraries(${cmd_NAME} cmdCore)
endif()
5 changes: 5 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ else()
# we must add MACOSX_BUNDLE only if building a bundle
add_executable(${APPLICATION_EXECUTABLE} WIN32 MACOSX_BUNDLE main.cpp ${APP_ICON})

if (BUILD_OWNCLOUD_OSX_BUNDLE)
set_target_properties(${APPLICATION_EXECUTABLE} PROPERTIES
OUTPUT_NAME "${APPLICATION_NAME}")
endif()

set (QM_DIR ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/Translations)
install(FILES ${client_I18N} DESTINATION ${QM_DIR})
get_target_property(_qmake Qt5::qmake LOCATION)
Expand Down

0 comments on commit d49818a

Please sign in to comment.