Build MacOS executables as bundles

This commit is contained in:
Lars Toenning
2023-11-21 19:51:51 +01:00
parent 6f29139d97
commit 662ae094b4
10 changed files with 85 additions and 29 deletions

View File

@@ -22,10 +22,22 @@ target_link_libraries(swiftcore
core
)
if(APPLE)
set_target_properties(swiftcore PROPERTIES MACOSX_BUNDLE TRUE)
set_target_properties(swiftcore PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
set(RESOURCE_FILES swiftcore.icns qt.conf)
target_sources(swiftcore PRIVATE ${RESOURCE_FILES})
set_target_properties(swiftcore PROPERTIES RESOURCE "${RESOURCE_FILES}")
endif()
add_dependencies(swiftcore resources)
if(WIN32)
add_dependencies(swiftcore copy_externals_to_build_dir)
endif()
install(TARGETS swiftcore)
if(APPLE)
install(TARGETS swiftcore BUNDLE DESTINATION bin)
else()
install(TARGETS swiftcore)
endif()

View File

@@ -7,19 +7,19 @@
<key>CFBundleDisplayName</key>
<string>swift core</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>swiftcore</string>
<key>CFBundleGetInfoString</key>
<string>swift project - free and open source pilot client</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<string>swiftcore.icns</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<string>org.swift-project.swiftcore</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<string>10.13</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>

View File

@@ -23,10 +23,22 @@ target_link_libraries(swiftdata
core
)
if(APPLE)
set_target_properties(swiftdata PROPERTIES MACOSX_BUNDLE TRUE)
set_target_properties(swiftdata PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
set(RESOURCE_FILES swiftdata.icns qt.conf)
target_sources(swiftdata PRIVATE ${RESOURCE_FILES})
set_target_properties(swiftdata PROPERTIES RESOURCE "${RESOURCE_FILES}")
endif()
add_dependencies(swiftdata resources)
if(WIN32)
add_dependencies(swiftdata copy_externals_to_build_dir)
endif()
install(TARGETS swiftdata)
if(APPLE)
install(TARGETS swiftdata BUNDLE DESTINATION bin)
else()
install(TARGETS swiftdata)
endif()

View File

@@ -7,19 +7,19 @@
<key>CFBundleDisplayName</key>
<string>swift data</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>swiftdata</string>
<key>CFBundleGetInfoString</key>
<string>swift project - free and open source pilot client</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<string>swiftdata.icns</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<string>org.swift-project.swiftdata</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<string>10.13</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>

View File

@@ -28,10 +28,22 @@ target_link_libraries(swiftguistd
sound
)
if(APPLE)
set_target_properties(swiftguistd PROPERTIES MACOSX_BUNDLE TRUE)
set_target_properties(swiftguistd PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
set(RESOURCE_FILES swift.icns qt.conf)
target_sources(swiftguistd PRIVATE ${RESOURCE_FILES})
set_target_properties(swiftguistd PROPERTIES RESOURCE "${RESOURCE_FILES}")
endif()
add_dependencies(swiftguistd resources)
if(WIN32)
add_dependencies(swiftguistd copy_externals_to_build_dir)
endif()
install(TARGETS swiftguistd)
if(APPLE)
install(TARGETS swiftguistd BUNDLE DESTINATION bin)
else()
install(TARGETS swiftguistd)
endif()

View File

@@ -7,19 +7,19 @@
<key>CFBundleDisplayName</key>
<string>swift gui</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>swiftguistd</string>
<key>CFBundleGetInfoString</key>
<string>swift project - free and open source pilot client</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<string>swift.icns</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<string>org.swift-project.swiftguistd</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<string>10.13</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>

View File

@@ -23,10 +23,22 @@ target_link_libraries(swiftlauncher
core
)
if(APPLE)
set_target_properties(swiftlauncher PROPERTIES MACOSX_BUNDLE TRUE)
set_target_properties(swiftlauncher PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
set(RESOURCE_FILES swiftlauncher.icns qt.conf)
target_sources(swiftlauncher PRIVATE ${RESOURCE_FILES})
set_target_properties(swiftlauncher PROPERTIES RESOURCE "${RESOURCE_FILES}")
endif()
add_dependencies(swiftlauncher resources)
if(WIN32)
add_dependencies(swiftlauncher copy_externals_to_build_dir)
endif()
install(TARGETS swiftlauncher)
if(APPLE)
install(TARGETS swiftlauncher BUNDLE DESTINATION bin)
else()
install(TARGETS swiftlauncher)
endif()

View File

@@ -7,19 +7,19 @@
<key>CFBundleDisplayName</key>
<string>swift launcher</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>swiftlauncher</string>
<key>CFBundleGetInfoString</key>
<string>swift project - free and open source pilot client</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<string>swiftlauncher.icns</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<string>org.swift-project.swiftlauncher</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>${QMAKE_PKGINFO_TYPEINFO}</string>
<string>????</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<string>10.13</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>