2021-03-03 02:03:52 +01:00
|
|
|
find_program(MACDEPLOYQT_EXECUTABLE NAMES macdeployqt PATHS /usr/local/opt/qt6/bin /usr/local/opt/qt5/bin /usr/local/bin REQUIRED)
|
2020-12-28 20:54:19 +01:00
|
|
|
if(MACDEPLOYQT_EXECUTABLE)
|
2020-12-28 21:28:45 +01:00
|
|
|
message(STATUS "Found macdeployqt: ${MACDEPLOYQT_EXECUTABLE}")
|
2020-12-24 15:24:48 +01:00
|
|
|
else()
|
|
|
|
message(WARNING "Missing macdeployqt executable.")
|
|
|
|
endif()
|
2020-08-26 22:35:18 +02:00
|
|
|
|
2021-03-03 02:03:52 +01:00
|
|
|
find_program(CREATEDMG_EXECUTABLE NAMES create-dmg REQUIRED)
|
2020-12-28 21:28:45 +01:00
|
|
|
if(CREATEDMG_EXECUTABLE)
|
|
|
|
message(STATUS "Found create-dmg: ${CREATEDMG_EXECUTABLE}")
|
|
|
|
else()
|
|
|
|
message(WARNING "Missing create-dmg executable.")
|
|
|
|
endif()
|
|
|
|
|
2020-12-24 15:24:48 +01:00
|
|
|
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/dist/macos/macversion.sh OUTPUT_VARIABLE MACOS_VERSION_PACKAGE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
if(NOT MACOS_VERSION_PACKAGE)
|
|
|
|
message(WARNING "Could not set macOS version.")
|
|
|
|
endif()
|
2020-12-06 06:45:08 +01:00
|
|
|
|
2020-12-28 21:28:45 +01:00
|
|
|
if(MACDEPLOYQT_EXECUTABLE AND CREATEDMG_EXECUTABLE AND MACOS_VERSION_PACKAGE)
|
2020-12-24 15:24:48 +01:00
|
|
|
add_custom_target(dmg
|
2020-12-24 20:49:51 +01:00
|
|
|
COMMAND ${MACDEPLOYQT_EXECUTABLE} strawberry.app -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/strawberry-tagreader
|
2020-12-24 15:24:48 +01:00
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/dist/macos/macdeploy.py strawberry.app
|
2020-12-28 21:28:45 +01:00
|
|
|
COMMAND ${CREATEDMG_EXECUTABLE} --volname strawberry --background "${CMAKE_SOURCE_DIR}/dist/macos/dmg_background.png" --app-drop-link 450 218 --icon strawberry.app 150 218 --window-size 600 450 strawberry-${STRAWBERRY_VERSION_PACKAGE}-${MACOS_VERSION_PACKAGE}-${CMAKE_HOST_SYSTEM_PROCESSOR}.dmg strawberry.app
|
2020-12-24 15:24:48 +01:00
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
)
|
|
|
|
add_custom_target(dmg2
|
2020-12-24 20:49:51 +01:00
|
|
|
COMMAND ${MACDEPLOYQT_EXECUTABLE} strawberry.app -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/strawberry-tagreader
|
2020-12-24 15:24:48 +01:00
|
|
|
COMMAND ${CMAKE_SOURCE_DIR}/dist/macos/macdeploy.py strawberry.app
|
2020-12-28 21:28:45 +01:00
|
|
|
COMMAND ${CREATEDMG_EXECUTABLE} --skip-jenkins --volname strawberry --background "${CMAKE_SOURCE_DIR}/dist/macos/dmg_background.png" --app-drop-link 450 218 --icon strawberry.app 150 218 --window-size 600 450 strawberry-${STRAWBERRY_VERSION_PACKAGE}-${MACOS_VERSION_PACKAGE}-${CMAKE_HOST_SYSTEM_PROCESSOR}.dmg strawberry.app
|
2020-12-24 15:24:48 +01:00
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
)
|
|
|
|
endif()
|