Commit d241d73c authored by Ghislain MARY's avatar Ghislain MARY

Create DMG package for Mac OS X.

parent e608cc51
......@@ -28,10 +28,6 @@ find_package(Git)
set(LINPHONE_QML_DIR "${LINPHONE_DESKTOP_DIR}/ui")
if(WIN32)
set(WINDEPLOYQT_PROGRAM windeployqt)
endif()
if(GIT_EXECUTABLE)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always
......@@ -173,7 +169,7 @@ endif()
if(WIN32)
execute_process(
COMMAND ${WINDEPLOYQT_PROGRAM} "${LINPHONE_OUTPUT_DIR}/bin/linphone.exe" "--qmldir" "${LINPHONE_QML_DIR}"
COMMAND windeployqt "${LINPHONE_OUTPUT_DIR}/bin/linphone.exe" "--qmldir" "${LINPHONE_QML_DIR}"
)
file(GLOB SHARE_CONTENT RELATIVE "${LINPHONE_OUTPUT_DIR}" "${LINPHONE_OUTPUT_DIR}/share/*")
......@@ -218,22 +214,22 @@ if(WIN32)
endif()
elseif(APPLE)
find_program(MAC_BUNDLER gtk-mac-bundler)
if(NOT MAC_BUNDLER)
message(FATAL_ERROR "Could not find gtk-mac-bundler executable!")
endif()
find_program(PATCH_PROGRAM patch)
if(NOT PATCH_PROGRAM)
message(FATAL_ERROR "Could not find patch executable!")
endif()
configure_file("${LINPHONE_SOURCE_DIR}/build/macos/Info-linphone.plist.in" "mac-bundler/Info-linphone.plist" @ONLY)
configure_file("${LINPHONE_SOURCE_DIR}/build/macos/environment.sh" "mac-bundler/environment.sh" COPYONLY)
configure_file("${LINPHONE_SOURCE_DIR}/gtk/gtkrc.mac" "mac-bundler/gtkrc" COPYONLY)
configure_file("${LINPHONE_SOURCE_DIR}/pixmaps/linphone.icns" "mac-bundler/linphone.icns" COPYONLY)
configure_file("mac-bundler/linphone.bundle" "mac-bundler/linphone.bundle" COPYONLY) # This file has to be different than the one in the linphone source code because of different file access paths
configure_file("mac-bundler/pkg-scripts/postinstall.in" "mac-bundler/pkg-scripts/postinstall" @ONLY)
configure_file("mac-bundler/call-bundler.cmake.in" "mac-bundler/call-bundler.cmake")
install(SCRIPT "${CMAKE_BINARY_DIR}/mac-bundler/call-bundler.cmake")
configure_file("Info.plist.in" "Linphone.app/Contents/Info.plist" @ONLY)
configure_file("linphone.icns" "Linphone.app/Contents/Resources/linphone.icns" COPYONLY)
file(COPY "${LINPHONE_OUTPUT_DIR}/bin/linphone" DESTINATION "Linphone.app/Contents/MacOS")
execute_process(
COMMAND macdeployqt "${CMAKE_CURRENT_BINARY_DIR}/Linphone.app" "-qmldir=${LINPHONE_QML_DIR}" "-verbose=2"
)
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Linphone.app" DESTINATION "." USE_SOURCE_PERMISSIONS)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/mediastreamer" DESTINATION "Linphone.app/Contents/Resources/lib" USE_SOURCE_PERMISSIONS)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/share/images" DESTINATION "Linphone.app/Contents/Resources/share" USE_SOURCE_PERMISSIONS)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/share/Linphone/rootca.pem" DESTINATION "Linphone.app/Contents/Resources/share/linphone" USE_SOURCE_PERMISSIONS)
install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/share/sounds" DESTINATION "Linphone.app/Contents/Resources/share" USE_SOURCE_PERMISSIONS)
configure_file("MacPackaging.cmake.in" "MacPackaging.cmake" @ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/MacPackaging.cmake")
endif()
if(MSVC)
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>linphone</string>
<key>CFBundleGetInfoString</key>
<string>@PACKAGE_VERSION@, (C) 2011-2017 The linphone team http://www.linphone.org</string>
<key>CFBundleIconFile</key>
<string>linphone.icns</string>
<key>CFBundleIdentifier</key>
<string>org.linphone.linphone</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@PACKAGE_VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@PACKAGE_VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2011-2017 Belledonne Communications</string>
<key>LSMinimumSystemVersion</key>
<string>@CMAKE_OSX_DEPLOYMENT_TARGET@</string>
<key>NSAppSleepDisabled</key>
<string>YES</string>
</dict>
</plist>
############################################################################
# MacPackaging.cmake
# Copyright (C) 2017 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
if(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES .*/_CPack_Packages/.*)
execute_process(
COMMAND ${CMAKE_CPACK_COMMAND} -G DragNDrop
RESULT_VARIABLE CPACK_COMMAND_SUCCESS
)
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment