mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-10-06 09:17:07 +02:00
Add basic .dmg bundle support
This commit is contained in:
parent
c9556f08d2
commit
8b10e5989f
@ -35,6 +35,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
|
option(OSX_BUNDLE "Enable distribution macOS bundle" OFF)
|
||||||
|
|
||||||
# This is needed for OSX: Because we bundle ScreenPlay and ScreenPlayWallpaper into .app they both need other QML dependencies like
|
# This is needed for OSX: Because we bundle ScreenPlay and ScreenPlayWallpaper into .app they both need other QML dependencies like
|
||||||
# ScreenPlayUtil. The fastest way is to use a shared QML module path for development and add this path to the qml engines import pah. For
|
# ScreenPlayUtil. The fastest way is to use a shared QML module path for development and add this path to the qml engines import pah. For
|
||||||
# the SCREENPLAY_DEPLOY we copy them into the matching dirs via the build.py
|
# the SCREENPLAY_DEPLOY we copy them into the matching dirs via the build.py
|
||||||
@ -113,6 +115,7 @@ if(UNIX AND NOT APPLE)
|
|||||||
endif()
|
endif()
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/FetchContentThirdParty.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/FetchContentThirdParty.cmake)
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(CMake)
|
add_subdirectory(CMake)
|
||||||
add_subdirectory(ScreenPlay)
|
add_subdirectory(ScreenPlay)
|
||||||
add_subdirectory(ScreenPlaySDK)
|
add_subdirectory(ScreenPlaySDK)
|
||||||
@ -138,7 +141,7 @@ if(WIN32)
|
|||||||
add_subdirectory(ScreenPlaySysInfo)
|
add_subdirectory(ScreenPlaySysInfo)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${SCREENPLAY_INSTALLER})
|
if(${SCREENPLAY_INSTALLER} AND NOT APPLE)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CreateIFWInstaller.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CreateIFWInstaller.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ if(${SCREENPLAY_TESTS})
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE AND NOT OSX_BUNDLE)
|
||||||
set_source_files_properties(
|
set_source_files_properties(
|
||||||
${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/translations")
|
${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.app/Contents/Resources/translations")
|
||||||
else()
|
else()
|
||||||
@ -371,7 +371,31 @@ if(WIN32)
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE AND OSX_BUNDLE)
|
||||||
|
# Set the installation destination
|
||||||
|
install(TARGETS "ScreenPlay" DESTINATION /Applications)
|
||||||
|
|
||||||
|
include(InstallRequiredSystemLibraries)
|
||||||
|
set(CPACK_GENERATOR "Bundle")
|
||||||
|
set(CPACK_BINARY_DRAGNDROP ON)
|
||||||
|
set(CPACK_BUNDLE_NAME "ScreenPlay")
|
||||||
|
set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/icons/app.ico")
|
||||||
|
set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/assets/icons/app.ico")
|
||||||
|
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist")
|
||||||
|
set(CPACK_BUNDLE_APPLE_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/entitlements.plist")
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "ScreenPlay-0.15")
|
||||||
|
include(CPack)
|
||||||
|
|
||||||
|
# Install all files from /bin
|
||||||
|
install(
|
||||||
|
DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
|
||||||
|
COMPONENT ScreenPlay
|
||||||
|
DESTINATION "./")
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(APPLE AND NOT OSX_BUNDLE)
|
||||||
# Creates a ScreenPlay.app
|
# Creates a ScreenPlay.app
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
${PROJECT_NAME}
|
${PROJECT_NAME}
|
||||||
|
@ -92,15 +92,17 @@ endif()
|
|||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Cocoa")
|
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Cocoa")
|
||||||
add_custom_command(
|
if(NOT OSX_BUNDLE)
|
||||||
TARGET ${PROJECT_NAME}
|
add_custom_command(
|
||||||
POST_BUILD
|
TARGET ${PROJECT_NAME}
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/index.html
|
POST_BUILD
|
||||||
${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/)
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/index.html
|
||||||
set_target_properties(${PROJECT_NAME}
|
${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/)
|
||||||
PROPERTIES
|
set_target_properties(${PROJECT_NAME}
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/"
|
PROPERTIES
|
||||||
)
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
@ -76,7 +76,7 @@ if(WIN32)
|
|||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
|
set_property(TARGET ${PROJECT_NAME} PROPERTY WIN32_EXECUTABLE true)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE AND NOT OSX_BUNDLE)
|
||||||
set_target_properties(${PROJECT_NAME}
|
set_target_properties(${PROJECT_NAME}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/"
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/"
|
||||||
|
@ -122,7 +122,7 @@ qt_add_qml_module(
|
|||||||
${RESOURCES})
|
${RESOURCES})
|
||||||
|
|
||||||
if(${SCREENPLAY_STEAM})
|
if(${SCREENPLAY_STEAM})
|
||||||
if(APPLE)
|
if(APPLE AND NOT OSX_BUNDLE)
|
||||||
set(MACOS_FRAMEWORKS_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ScreenPlay.app/Contents/MacOS/)
|
set(MACOS_FRAMEWORKS_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ScreenPlay.app/Contents/MacOS/)
|
||||||
file(MAKE_DIRECTORY ${MACOS_FRAMEWORKS_DIR})
|
file(MAKE_DIRECTORY ${MACOS_FRAMEWORKS_DIR})
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${MACOS_FRAMEWORKS_DIR} COPYONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${MACOS_FRAMEWORKS_DIR} COPYONLY)
|
||||||
|
Loading…
Reference in New Issue
Block a user