DeployMacros.cmake for Apple resurrect
This commit is contained in:
@@ -898,12 +898,16 @@ macro(deploy_target _T)
|
||||
set_target_properties(${_T} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${_modules_dir}/SHSMacOSBundle.plist.in")
|
||||
set(_AGD "${_DEPLOY_DIR}/${_T}.app")
|
||||
set(_DMG "${CMAKE_CURRENT_BINARY_DIR}/dmg")
|
||||
__make_copy(_CMD_ _RES_DIRS _RES_FILES "${_AGD}/Contents/Resources")
|
||||
__make_copy(_CMD_ _PLUG_DIRS _PLUG_FILES "${_AGD}/Contents/PlugIns")
|
||||
__make_copy(_CMD_ _FILE_DIRS _FILE_FILES "${_AGD}/Contents/MacOS")
|
||||
__make_copy(_CMD_ _LIBS_DIRS _LIBS_FILES "${_AGD}/Contents/Frameworks")
|
||||
set(_bin_path "${_AGD}/Contents/MacOS")
|
||||
set(_lib_path "${_AGD}/Contents/Frameworks")
|
||||
set(_pli_path "${_AGD}/Contents/PlugIns")
|
||||
set(_res_path "${_AGD}/Contents/Resources")
|
||||
__make_copy(_CMD_ _RES_DIRS _RES_FILES "${_res_path}")
|
||||
__make_copy(_CMD_ _PLUG_DIRS _PLUG_FILES "${_pli_path}")
|
||||
__make_copy(_CMD_ _FILE_DIRS _FILE_FILES "${_bin_path}")
|
||||
__make_copy(_CMD_ _LIBS_DIRS _LIBS_FILES "${_lib_path}")
|
||||
if (_ICON_NAME)
|
||||
set(_CMD_ ${_CMD_} COMMAND cp ${_VERB} -f "${_ICON_FN}" "${_AGD}/Contents/Resources")
|
||||
set(_CMD_ ${_CMD_} COMMAND cp ${_VERB} -f "${_ICON_FN}" "${_res_path}")
|
||||
endif()
|
||||
if (NOT CMAKE_OTOOL)
|
||||
set(CMAKE_OTOOL "otool")
|
||||
@@ -917,7 +921,7 @@ macro(deploy_target _T)
|
||||
set(_cmd_gen_dmg COMMAND hdiutil create "${_DESTINATION}/${_dmg_name}" -ov -volname "${MACOSX_BUNDLE_BUNDLE_NAME}" -fs HFS+ -srcfolder "${_DMG}")
|
||||
endif()
|
||||
if (_ZIP_DMG)
|
||||
set(_cmd_gen_dmg ${_cmd_gen_dmg} COMMAND zip -q -r "\"${_DESTINATION}/${_dmg_name}.zip\"" "\"${_DESTINATION}/${_dmg_name}\"")
|
||||
set(_cmd_gen_dmg ${_cmd_gen_dmg} COMMAND cd "${_DESTINATION}" "&&" zip -q -r "${_dmg_name}.zip" "${_dmg_name}")
|
||||
set(_cmd_gen_dmg ${_cmd_gen_dmg} COMMAND rm "\"${_DESTINATION}/${_dmg_name}\"")
|
||||
endif()
|
||||
set(_comment "Generating ${_dmg_name}")
|
||||
@@ -926,11 +930,12 @@ macro(deploy_target _T)
|
||||
endif()
|
||||
add_custom_target(deploy_${_T}
|
||||
# gather .app dir
|
||||
COMMAND mkdir ${_VERB} -p "${_AGD}/Contents/Resources"
|
||||
COMMAND mkdir ${_VERB} -p "${_AGD}/Contents/Frameworks"
|
||||
COMMAND mkdir ${_VERB} -p "${_res_path}"
|
||||
COMMAND mkdir ${_VERB} -p "${_lib_path}"
|
||||
COMMAND mkdir ${_VERB} -p "${_pli_path}"
|
||||
COMMAND mkdir ${_VERB} -p "${_DESTINATION}"
|
||||
${_CMD_}
|
||||
COMMAND ${PIP_DEPLOY_TOOL} ${_VERB} ${_OPTIONS} -M "${CMAKE_OTOOL}" -P cocoa,minimal -S mac -q "${Qt5_ROOT}" -s "\"${CMAKE_PREFIX_PATH}/lib${_add_search_path}\"" -o "${_AGD}/Contents/Frameworks" -p "${_AGD}/Contents/PlugIns" "${_AGD}/Contents/MacOS/${_T}" ${_ADD_DEPS}
|
||||
COMMAND ${PIP_DEPLOY_TOOL} ${_VERB} ${_OPTIONS} -M "${CMAKE_OTOOL}" -P cocoa,minimal -S mac -q "${Qt5_ROOT}" --qt-conf-dir "${_bin_path}" --qt-plugins-dir "${_pli_path}" -s "${CMAKE_PREFIX_PATH}/lib${_add_search_path}" -o "${_lib_path}" "${_bin_path}/${_T}" ${_ADD_DEPS}
|
||||
# prepare dmg dir
|
||||
COMMAND rm -rf "${_DMG}"
|
||||
COMMAND mkdir ${_VERB} -p "${_DMG}"
|
||||
|
||||
Reference in New Issue
Block a user