feat(macOS): initial macOS bundle support
This commit is contained in:
parent
c789d04a6c
commit
cdadaa874e
3
.gitignore
vendored
3
.gitignore
vendored
@ -6,3 +6,6 @@
|
||||
|
||||
# User config file
|
||||
CMakeLists.txt.user*
|
||||
|
||||
# Why, macOS, why?
|
||||
.DS_Store
|
||||
|
@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(pineapple-music LANGUAGES CXX)
|
||||
project(pineapple-music LANGUAGES CXX VERSION 0.3.0)
|
||||
|
||||
include (GNUInstallDirs)
|
||||
include (FeatureSummary)
|
||||
@ -67,7 +67,7 @@ set (EXE_NAME pmusic)
|
||||
file (GLOB PMUSIC_TS_FILES languages/*.ts)
|
||||
set (PMUSIC_CPP_FILES_FOR_I18N ${PMUSIC_CPP_FILES} ${PMUSIC_UI_FILES})
|
||||
|
||||
add_executable(${EXE_NAME} WIN32
|
||||
add_executable(${EXE_NAME}
|
||||
${PMUSIC_HEADER_FILES}
|
||||
${PMUSIC_CPP_FILES}
|
||||
${PMUSIC_UI_FILES}
|
||||
@ -103,8 +103,23 @@ endif()
|
||||
|
||||
# Install settings
|
||||
if (WIN32)
|
||||
# FIXME: try to avoid install to a "bin" subfolder under windows...
|
||||
# when fixed, don't forget to update the CI config file...
|
||||
set_target_properties(${EXE_NAME} PROPERTIES
|
||||
WIN32_EXECUTABLE TRUE
|
||||
)
|
||||
elseif (APPLE)
|
||||
set_source_files_properties(assets/icons/app-icon.icns PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION "Resources"
|
||||
)
|
||||
target_sources(${EXE_NAME} PUBLIC assets/icons/app-icon.icns)
|
||||
# See https://cmake.org/cmake/help/v3.15/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html
|
||||
set_target_properties(${EXE_NAME} PROPERTIES
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "Pineapple Music"
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER net.blumia.pineapple-music
|
||||
MACOSX_BUNDLE_ICON_FILE app-icon.icns # contains the .icns file name, *without* the path.
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
)
|
||||
elseif (UNIX)
|
||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX /usr)
|
||||
@ -125,6 +140,7 @@ elseif (UNIX)
|
||||
endif()
|
||||
|
||||
set (INSTALL_TARGETS_DEFAULT_ARGS
|
||||
BUNDLE DESTINATION .
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Devel
|
||||
|
BIN
assets/icons/app-icon.icns
Normal file
BIN
assets/icons/app-icon.icns
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user