diff --git a/cmake_builder/linphone_package/CMakeLists.txt b/cmake_builder/linphone_package/CMakeLists.txt index 341d59296..7043e0195 100644 --- a/cmake_builder/linphone_package/CMakeLists.txt +++ b/cmake_builder/linphone_package/CMakeLists.txt @@ -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) diff --git a/cmake_builder/linphone_package/Info.plist.in b/cmake_builder/linphone_package/Info.plist.in new file mode 100644 index 000000000..ef51a1bd6 --- /dev/null +++ b/cmake_builder/linphone_package/Info.plist.in @@ -0,0 +1,33 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + linphone + CFBundleGetInfoString + @PACKAGE_VERSION@, (C) 2011-2017 The linphone team http://www.linphone.org + CFBundleIconFile + linphone.icns + CFBundleIdentifier + org.linphone.linphone + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + @PACKAGE_VERSION@ + CFBundleSignature + ???? + CFBundleVersion + @PACKAGE_VERSION@ + NSHumanReadableCopyright + Copyright 2011-2017 Belledonne Communications + LSMinimumSystemVersion + @CMAKE_OSX_DEPLOYMENT_TARGET@ + NSAppSleepDisabled + YES + + + diff --git a/cmake_builder/linphone_package/MacPackaging.cmake.in b/cmake_builder/linphone_package/MacPackaging.cmake.in new file mode 100644 index 000000000..063bd4742 --- /dev/null +++ b/cmake_builder/linphone_package/MacPackaging.cmake.in @@ -0,0 +1,28 @@ +############################################################################ +# 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() diff --git a/cmake_builder/linphone_package/linphone.icns b/cmake_builder/linphone_package/linphone.icns new file mode 100644 index 000000000..0a0a20727 Binary files /dev/null and b/cmake_builder/linphone_package/linphone.icns differ