From 2bede0b84bb9062dbc9620159211b384c98909cc Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 18 Feb 2020 13:32:53 +0100 Subject: [PATCH 01/11] Update CMakeLists to GPLv3 and speedup build process by removing subdirectory if its output exists (Linphone-SDK and Minizip) --- CMakeLists.txt | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35d86577f..aa18626cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,27 +1,27 @@ ################################################################################ -# CMakeLists.txt -# Copyright (C) 2017-2020 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. +# Copyright (c) 2010-2020 Belledonne Communications SARL. +# +# This file is part of linphone-desktop +# (see https://www.linphone.org). +# +# 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 3 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, see . # ################################################################################ # First building command: -# cmake .. -DENABLE_VPX=NO && cmake --build . --target all --parallel 10 && cmake --build . --target install && cmake .. +# cmake .. && cmake --build . --target all --parallel 10 && cmake --build . --target install && cmake .. # Logic : Prepare first building of the SDK and Minizip. Install binaries and prepare for application building. # Next, we can build the application with cmake --build . --target all --parallel 10 && cmake --build . --target install @@ -51,7 +51,6 @@ include(application_info.cmake) # ------------------------------------------------------------------------------ set(TARGET_NAME linphone-qt) - set(CMAKE_CXX_STANDARD 11) #------------------------------------------------------------------------------- @@ -74,16 +73,11 @@ else()##Opus crash on Linux. The version for 4.3 is old. We have to use a switch option(ENABLE_V4L "Ability to capture and display video using libv4l2 or libv4l." YES) endif() - option(ENABLE_RELATIVE_PREFIX "Set Internal packages relative to the binary" YES) include(GNUInstallDirs) include(CheckCXXCompilerFlag) - - -add_subdirectory("linphone-sdk" "linphone-sdk/build-sdk") - find_package(LinphoneCxx CONFIG) find_package(Linphone CONFIG) find_package(bctoolbox CONFIG) @@ -91,17 +85,16 @@ find_package(belcard CONFIG) find_package(Mediastreamer2 CONFIG) find_package(ortp CONFIG) - if( NOT (LinphoneCxx_FOUND)) message("Linphone packages are not installed. Build and install it in order to build Minizip and then Desktop Application.") + add_subdirectory("linphone-sdk" "linphone-sdk/build-sdk") else() # Linphone SDK has been builded - message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") - add_subdirectory(submodules/externals/minizip "submodules/externals/minizip/build-minizip") - add_dependencies(minizip sdk) + message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") find_package(Minizip) if( NOT(Minizip_FOUND)) message("Minizip are not installed. Build and install it in order to build Desktop Application.") + add_subdirectory(submodules/externals/minizip "submodules/externals/minizip/build-minizip") else() message("MINIZIP : ${MINIZIP_INCLUDE_DIRS} => ${MINIZIP_LIBRARIES}") message("INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} FRAMEWORK_PATH=${CMAKE_FRAMEWORK_PATH}") From 257c67a51d6eecdb17a94565ec322b7fd6b73080 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Wed, 19 Feb 2020 15:40:26 +0100 Subject: [PATCH 02/11] Update Readme, simplify build_windows, fix resources folder only for Mac --- README.md | 12 ++++++------ build_all_win.bat | 8 +++----- src/app/paths/Paths.cpp | 2 ++ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index df0e64e10..67f8783df 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,13 @@ Go to this new folder and begin the build process : `cd build-desktop` 2. Prepare your options : `cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo` By default, it will try compile all dependencies. You can remove some by adding `-ENABLE_=NO` to the command. You can use `cmake-gui ..` if you want to have a better access to them. -3. Build the SDK : `cmake --build . --target sdk`. You can add `--parallel 10` if you have CMake>3.12 to speedup the process. +3. Build the SDK : `cmake --build . --target sdk --config RelWithDebInfo`. You can add `--parallel 10` if you have CMake>3.12 to speedup the process. -4. Build The submodule. `cmake ..` and `cmake --build . --target install` +4. Build The submodule. `cmake ..` and `cmake --build . --target install --config RelWithDebInfo` -5. Finish the process with a new `cmake ..` and `cmake --build . --target install`. +5. Finish the process with a new `cmake ..` and `cmake --build . --target install --config RelWithDebInfo`. + +It is important to set the config in the process or you can have a bad configuration for your binary that could lead to some corruption : on Windows, this issue is spotted when trying to start the application and an empty file with a random name is created. So, you are working on an IDE (like Qt Creator), you may override the build command. When all are over, the files will be in the OUTPUT folder in the build directory. @@ -90,8 +92,6 @@ Usually, if it is about VPX or Decaf, this could come from your Perl installatio - - #### Mac OS X Troubleshooting To install the required dependencies on Mac OS X, you can use [Homebrew](https://brew.sh/). Before you install packages with Brew, you may have to change directories permissions (if you can't change permissions with sudo on a MacOS >= High Sierra, get a look at [this StackOverflow answer](https://stackoverflow.com/questions/16432071/how-to-fix-homebrew-permissions#46844441)). @@ -128,7 +128,7 @@ Before you install packages with Brew, you may have to change directories permis ### Installing Linux dependencies -From 4.1 version of Desktop: +Dependencies from 4.1 version of Desktop: apt-get install libqt53dcore5:amd64 libqt53dextras5:amd64 libqt53dinput5:amd64 libqt53dlogic5:amd64 libqt53dquick5:amd64 libqt53dquickextras5:amd64 libqt53dquickinput5:amd64 libqt53dquickrender5:amd64 libqt53drender5:amd64 libqt5concurrent5:amd64 libqt5core5a:amd64 libqt5dbus5:amd64 libqt5designer5:amd64 libqt5designercomponents5:amd64 libqt5gui5:amd64 libqt5help5:amd64 libqt5multimedia5:amd64 libqt5multimedia5-plugins:amd64 libqt5multimediawidgets5:amd64 libqt5network5:amd64 libqt5opengl5:amd64 libqt5opengl5-dev:amd64 libqt5positioning5:amd64 libqt5printsupport5:amd64 libqt5qml5:amd64 libqt5quick5:amd64 libqt5quickcontrols2-5:amd64 libqt5quickparticles5:amd64 libqt5quicktemplates2-5:amd64 libqt5quicktest5:amd64 libqt5quickwidgets5:amd64 libqt5script5:amd64 libqt5scripttools5:amd64 libqt5sensors5:amd64 libqt5serialport5:amd64 libqt5sql5:amd64 libqt5sql5-sqlite:amd64 libqt5svg5:amd64 libqt5svg5-dev:amd64 libqt5test5:amd64 libqt5webchannel5:amd64 libqt5webengine-data libqt5webenginecore5:amd64 libqt5webenginewidgets5:amd64 libqt5webkit5:amd64 libqt5widgets5:amd64 libqt5x11extras5:amd64 libqt5xml5:amd64 libqt5xmlpatterns5:amd64 qt5-default:amd64 qt5-doc qt5-gtk-platformtheme:amd64 qt5-qmake:amd64 qt5-qmltooling-plugins:amd64 diff --git a/build_all_win.bat b/build_all_win.bat index de71f6f30..9bf04298c 100644 --- a/build_all_win.bat +++ b/build_all_win.bat @@ -9,16 +9,14 @@ cmake .. -DLINPHONESDK_PLATFORM=Desktop -DCMAKE_BUILD_TYPE=RelWithDebInfo -A Win :: Mini config ::cmake .. -DLINPHONESDK_PLATFORM=Desktop -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_VPX=NO -DENABLE_OPUS=NO -A Win32 -DENABLE_VIDEO=YES -DENABLE_GL=YES if %errorlevel% neq 0 exit /b %errorlevel% -cmake --build . --target sdk --config RelWithDebInfo --parallel 10 +cmake --build . --target sdk --config RelWithDebInfo --parallel 10 -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false;DoNotCopyLocalIfInGac=true;CL_MPCount=16 if %errorlevel% neq 0 exit /b %errorlevel% :: Minizip Submodule Building cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -A Win32 -cmake --build . --target all_build --parallel 10 --config RelWithDebInfo -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false -cmake --build . --target install --config RelWithDebInfo -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false +cmake --build . --target install --config RelWithDebInfo --parallel 10 -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false;DoNotCopyLocalIfInGac=true;CL_MPCount=16 :: Desktop Building cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -A Win32 if %errorlevel% neq 0 exit /b %errorlevel% -cmake --build . --target all_build --config RelWithDebInfo --parallel 10 -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false -cmake --build . --target install --config RelWithDebInfo -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false +cmake --build . --target install --config RelWithDebInfo --parallel 10 -- /maxcpucount /nodeReuse:true /p:TrackFileAccess=false;DoNotCopyLocalIfInGac=true;CL_MPCount=16 diff --git a/src/app/paths/Paths.cpp b/src/app/paths/Paths.cpp index 21acfb6dc..fc78c6fb0 100644 --- a/src/app/paths/Paths.cpp +++ b/src/app/paths/Paths.cpp @@ -136,11 +136,13 @@ static inline QDir getAppPackageDir () { static inline QString getAppPackageDataDirPath() { QDir dir = getAppPackageDir(); +#ifdef APPLE if (!dir.cd("Resources")) { dir.mkdir("Resources"); dir.cd("Resources"); } +#endif if (!dir.cd("share")) { dir.mkdir("share"); From 5cd0804ed7e7a7c6122f92542de8fca5e1abea62 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 20 Feb 2020 10:27:04 +0100 Subject: [PATCH 03/11] - Add icons generator for inkscape 1.0 - Remove hardlinks --- assets/icons/genicons_1.0.sh | 27 +++++++++++++++++++ cmake_builder/install.cmake | 6 ++--- cmake_builder/linphone_package/CMakeLists.txt | 4 +-- .../linphone_package/macos/Info.plist.in | 4 +-- 4 files changed, 34 insertions(+), 7 deletions(-) create mode 100755 assets/icons/genicons_1.0.sh diff --git a/assets/icons/genicons_1.0.sh b/assets/icons/genicons_1.0.sh new file mode 100755 index 000000000..2994f1b34 --- /dev/null +++ b/assets/icons/genicons_1.0.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +## +## Copyright (c) 2010-2020 Belledonne Communications SARL. +## +## This file is part of linphone-desktop +## (see https://www.linphone.org). +## +## 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 3 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, see . +## + +for i in 16 22 24 32 64 128 256 +do + mkdir -p hicolor/${i}x${i}/apps + inkscape -z --export-type=png --export-file=hicolor/${i}x${i}/apps/icon.png -w $i -h $i ../images/linphone_logo.svg +done +convert hicolor/16x16/apps/icon.png hicolor/22x22/apps/icon.png hicolor/24x24/apps/icon.png hicolor/32x32/apps/icon.png hicolor/64x64/apps/icon.png hicolor/128x128/apps/icon.png hicolor/256x256/apps/icon.png -colors 256 ../icon.ico diff --git a/cmake_builder/install.cmake b/cmake_builder/install.cmake index a2ab59415..b327360e8 100644 --- a/cmake_builder/install.cmake +++ b/cmake_builder/install.cmake @@ -19,10 +19,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # ############################################################################ - +include(../application_info.cmake) if (APPLE) #execute_process(COMMAND install_name_tool -id "@executable_path/../lib/libminizip.dylib" "${CMAKE_INSTALL_PREFIX}/lib/libminizip.dylib") - execute_process(COMMAND install_name_tool -add_rpath "@executable_path/../Frameworks/" "${CMAKE_INSTALL_PREFIX}/bin/linphone") - execute_process(COMMAND install_name_tool -add_rpath "@executable_path/../lib/" "${CMAKE_INSTALL_PREFIX}/bin/linphone") + execute_process(COMMAND install_name_tool -add_rpath "@executable_path/../Frameworks/" "${CMAKE_INSTALL_PREFIX}/bin/${EXECUTABLE_NAME}") + execute_process(COMMAND install_name_tool -add_rpath "@executable_path/../lib/" "${CMAKE_INSTALL_PREFIX}/bin/${EXECUTABLE_NAME}") else () endif () diff --git a/cmake_builder/linphone_package/CMakeLists.txt b/cmake_builder/linphone_package/CMakeLists.txt index 08a66abbb..3be42fe8f 100644 --- a/cmake_builder/linphone_package/CMakeLists.txt +++ b/cmake_builder/linphone_package/CMakeLists.txt @@ -213,7 +213,7 @@ elseif (APPLE) install(FILES "${LINPHONE_SDK_TMP}/share/Belr/grammars/vcard_grammar" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/belr/grammars/") install(DIRECTORY "${LINPHONE_SDK_TMP}/share/images" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share" USE_SOURCE_PERMISSIONS) install(DIRECTORY "${LINPHONE_SDK_TMP}/share/sounds" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share" USE_SOURCE_PERMISSIONS) - install(FILES "${LINPHONE_SDK_TMP}/share/${APPLICATION_NAME}/rootca.pem" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}") + install(FILES "${LINPHONE_SDK_TMP}/share/Linphone/rootca.pem" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}") install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/linphonerc-factory" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}") install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/assistant/use-other-sip-account.rc" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}/assistant") @@ -279,7 +279,7 @@ else()# Not Windows and Apple # install(DIRECTORY "${LINPHONE_SDK_TMP}/share/images" DESTINATION "share" USE_SOURCE_PERMISSIONS) # install(DIRECTORY "${LINPHONE_SDK_TMP}/share/sounds" DESTINATION "share" USE_SOURCE_PERMISSIONS) #install(FILES "${LINPHONE_SDK_TMP}/share/${APPLICATION_NAME}/rootca.pem" DESTINATION "share/${APPLICATION_NAME}") - install(FILES "${LINPHONE_SDK_TMP}/share/${EXECUTABLE_NAME}/rootca.pem" DESTINATION "share/${APPLICATION_NAME}") #We use executable_name because of name folder that is not harmonized from the SDK + install(FILES "${LINPHONE_SDK_TMP}/share/linphone/rootca.pem" DESTINATION "share/${APPLICATION_NAME}") #We use executable_name because of name folder that is not harmonized from the SDK # install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/linphonerc-factory" DESTINATION "share/${APPLICATION_NAME}") # install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/assistant/use-other-sip-account.rc" DESTINATION "share/${APPLICATION_NAME}/assistant") diff --git a/cmake_builder/linphone_package/macos/Info.plist.in b/cmake_builder/linphone_package/macos/Info.plist.in index 1703aa7e8..c5556fd6b 100644 --- a/cmake_builder/linphone_package/macos/Info.plist.in +++ b/cmake_builder/linphone_package/macos/Info.plist.in @@ -13,9 +13,9 @@ CFBundleGetInfoString @PACKAGE_VERSION@, (C) 2011-2018 @APPLICATION_NAME@ @APPLICATION_URL@ CFBundleIconFile - linphone.icns + @EXECUTABLE_NAME@.icns CFBundleIdentifier - org.linphone.linphone + @APPLICATION_ID@ CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType From 144fcf7d44f01e71fb9817b2c96bd4e2e511ce12 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 20 Feb 2020 10:28:29 +0100 Subject: [PATCH 04/11] - Update About to GPLv3 - Add temporary Flip on preview - Add Application vendor name in configurations --- src/app/main.cpp | 2 -- src/config.h.cmake | 1 + ui/views/App/Calls/Incall.qml | 6 +++--- ui/views/App/Main/Dialogs/About.qml | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/main.cpp b/src/app/main.cpp index f5e277863..12f8b8866 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -23,8 +23,6 @@ // ============================================================================= int main (int argc, char *argv[]) { - QApplication::setOrganizationName("Belledonne-Communications"); - QApplication::setOrganizationDomain("linphone.org"); AppController controller(argc, argv); //QLoggingCategory::setFilterRules("*.debug=true;qml=false"); App *app = controller.getApp(); diff --git a/src/config.h.cmake b/src/config.h.cmake index 02462415f..5d0a5dcf2 100644 --- a/src/config.h.cmake +++ b/src/config.h.cmake @@ -23,6 +23,7 @@ #cmakedefine APPLICATION_DESCRIPTION "${APPLICATION_DESCRIPTION}" #cmakedefine APPLICATION_ID "${APPLICATION_ID}" #cmakedefine APPLICATION_NAME "${APPLICATION_NAME}" +#cmakedefine APPLICATION_VENDOR "${APPLICATION_VENDOR}" #cmakedefine ENABLE_UPDATE_CHECK 1 #cmakedefine EXECUTABLE_NAME "${EXECUTABLE_NAME}" #cmakedefine MSPLUGINS_DIR "${MSPLUGINS_DIR}" diff --git a/ui/views/App/Calls/Incall.qml b/ui/views/App/Calls/Incall.qml index e48dfb5e4..b54b0a084 100644 --- a/ui/views/App/Calls/Incall.qml +++ b/ui/views/App/Calls/Incall.qml @@ -381,9 +381,9 @@ Rectangle { height: CallStyle.actionArea.userVideo.height width: CallStyle.actionArea.userVideo.width // Function to use if we want to manually Flip horizontally the preview without MSOGL -// transform: Matrix4x4 { -// matrix: Qt.matrix4x4(-1, 0, 0, CallStyle.actionArea.userVideo.width, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) -// } + transform: Matrix4x4 { + matrix: Qt.matrix4x4(-1, 0, 0, CallStyle.actionArea.userVideo.width, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) + } active: incall.width >= CallStyle.actionArea.lowWidth && incall.call.videoEnabled && !_fullscreen sourceComponent: cameraPreview diff --git a/ui/views/App/Main/Dialogs/About.qml b/ui/views/App/Main/Dialogs/About.qml index 24bea58b1..af3709b29 100644 --- a/ui/views/App/Main/Dialogs/About.qml +++ b/ui/views/App/Main/Dialogs/About.qml @@ -104,7 +104,7 @@ DialogPlus { elide: Text.ElideRight font.pointSize: AboutStyle.copyrightBlock.license.pointSize - text: 'GNU General Public License V2\n\u00A9 2010-' + + text: 'GNU General Public License V3\n\u00A9 2010-' + (new Date().toLocaleDateString(Qt.locale(), 'yyyy')) + ' Belledonne Communications' From 7e6da5d94011b752651946305b59d913a61ca06e Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 20 Feb 2020 10:29:31 +0100 Subject: [PATCH 05/11] - Correct Vendor name to remove spaces - replace Organization Domain from configuration --- src/app/AppController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/AppController.cpp b/src/app/AppController.cpp index af2a2a1b3..1b5162294 100644 --- a/src/app/AppController.cpp +++ b/src/app/AppController.cpp @@ -40,7 +40,6 @@ namespace { AppController::AppController (int &argc, char *argv[]) { QT_REQUIRE_VERSION(argc, argv, ApplicationMinimalQtVersion) Q_ASSERT(!mApp); - // Disable QML cache. Avoid malformed cache. qputenv("QML_DISABLE_DISK_CACHE", "true"); @@ -59,6 +58,8 @@ AppController::AppController (int &argc, char *argv[]) { // The EXECUTABLE_NAME will be used in qt standard paths. It's our goal. QCoreApplication::setApplicationName(EXECUTABLE_NAME); QCoreApplication::setApplicationVersion(LINPHONE_QT_GIT_VERSION); + QApplication::setOrganizationName(QString(APPLICATION_VENDOR).replace(' ', '-')); + QApplication::setOrganizationDomain(APPLICATION_ID); mApp = new App(argc, argv); QQuickStyle::setStyle("Default"); From cc51a0c44ea25f385c3bb6eba286a3773607df35 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 20 Feb 2020 20:19:50 +0100 Subject: [PATCH 06/11] Update SDK version --- linphone-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linphone-sdk b/linphone-sdk index 9bbf905c4..471ecaa3d 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 9bbf905c45d298d98dca5ef2eac6288e5cb70af7 +Subproject commit 471ecaa3d6e9af94caf24e1427704b8de5537ed6 From 4e7b565b5a27f0825a046c136062b5b7b98c6639 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 20 Feb 2020 20:21:29 +0100 Subject: [PATCH 07/11] Update CMakeLists.txt [ci skip] --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa18626cb..ea46fb4dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ find_package(belcard CONFIG) find_package(Mediastreamer2 CONFIG) find_package(ortp CONFIG) -if( NOT (LinphoneCxx_FOUND)) +if( NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND)) message("Linphone packages are not installed. Build and install it in order to build Minizip and then Desktop Application.") add_subdirectory("linphone-sdk" "linphone-sdk/build-sdk") else() From bd15738a46956dd1b285e53c4df436db76904c62 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 21 Feb 2020 14:07:32 +0100 Subject: [PATCH 08/11] - Remove zipped sdk - fix freeze on VP8/mpeg decoders --- CMakeLists.txt | 792 +++++++++--------- cmake_builder/linphone_package/CMakeLists.txt | 35 +- linphone-sdk | 2 +- 3 files changed, 415 insertions(+), 414 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea46fb4dd..6b5e12b67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # Avoid cmake warning if CMP0071 is not set. if (POLICY CMP0071) - cmake_policy(SET CMP0071 NEW) + cmake_policy(SET CMP0071 NEW) endif () #set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -87,447 +87,447 @@ find_package(ortp CONFIG) if( NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND)) message("Linphone packages are not installed. Build and install it in order to build Minizip and then Desktop Application.") - add_subdirectory("linphone-sdk" "linphone-sdk/build-sdk") + add_subdirectory("linphone-sdk" "linphone-sdk/build-sdk") else() -# Linphone SDK has been builded - message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") - find_package(Minizip) + # Linphone SDK has been builded + message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") + find_package(Minizip) if( NOT(Minizip_FOUND)) - message("Minizip are not installed. Build and install it in order to build Desktop Application.") - add_subdirectory(submodules/externals/minizip "submodules/externals/minizip/build-minizip") + message("Minizip are not installed. Build and install it in order to build Desktop Application.") + add_subdirectory(submodules/externals/minizip "submodules/externals/minizip/build-minizip") else() - message("MINIZIP : ${MINIZIP_INCLUDE_DIRS} => ${MINIZIP_LIBRARIES}") - message("INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} FRAMEWORK_PATH=${CMAKE_FRAMEWORK_PATH}") - message("LINPHONE : ${LINPHONE_INCLUDE_DIRS} => ${LINPHONE_LIBRARIES}") - message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") - -# Build configuration - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -DQT_NO_DEBUG") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG") - if( WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WINSOCKAPI_")#remove error from windows headers order - endif() - set(CMAKE_INCLUDE_CURRENT_DIR ON)#useful for config.h - - set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network) - if (UNIX AND NOT APPLE) - list(APPEND QT5_PACKAGES DBus) - endif () - set(QT5_PACKAGES_OPTIONAL TextToSpeech) - set(CMAKE_AUTOMOC ON) -#------------------------------------------------- - set(ASSETS_DIR "assets") - set(SOURCES - src/app/App.cpp - src/app/AppController.cpp - src/app/cli/Cli.cpp - src/app/logger/Logger.cpp - src/app/paths/Paths.cpp - src/app/providers/AvatarProvider.cpp - src/app/providers/ImageProvider.cpp - src/app/providers/ThumbnailProvider.cpp - src/app/translator/DefaultTranslator.cpp - src/components/assistant/AssistantModel.cpp - src/components/authentication/AuthenticationNotifier.cpp - src/components/call/CallModel.cpp - src/components/calls/CallsListModel.cpp - src/components/calls/CallsListProxyModel.cpp - src/components/camera/Camera.cpp - src/components/camera/CameraPreview.cpp - src/components/camera/MSFunctions.cpp - src/components/chat/ChatModel.cpp - src/components/chat/ChatProxyModel.cpp - src/components/codecs/AbstractCodecsModel.cpp - src/components/codecs/AudioCodecsModel.cpp - src/components/codecs/VideoCodecsModel.cpp - src/components/conference/ConferenceAddModel.cpp - src/components/conference/ConferenceHelperModel.cpp - src/components/conference/ConferenceModel.cpp - src/components/contact/ContactModel.cpp - src/components/contact/VcardModel.cpp - src/components/contacts/ContactsListModel.cpp - src/components/contacts/ContactsListProxyModel.cpp - src/components/core/CoreHandlers.cpp - src/components/core/CoreManager.cpp - src/components/core/event-count-notifier/AbstractEventCountNotifier.cpp - src/components/file/FileDownloader.cpp - src/components/file/FileExtractor.cpp - src/components/notifier/Notifier.cpp - src/components/other/clipboard/Clipboard.cpp - src/components/other/colors/Colors.cpp - src/components/other/text-to-speech/TextToSpeech.cpp - src/components/other/units/Units.cpp - src/components/presence/OwnPresenceModel.cpp - src/components/presence/Presence.cpp - src/components/settings/AccountSettingsModel.cpp - src/components/settings/SettingsModel.cpp - src/components/sip-addresses/SipAddressesModel.cpp - src/components/sip-addresses/SipAddressesProxyModel.cpp - src/components/sip-addresses/SipAddressObserver.cpp - src/components/sound-player/SoundPlayer.cpp - src/components/telephone-numbers/TelephoneNumbersModel.cpp - src/components/timeline/TimelineModel.cpp - src/components/url-handlers/UrlHandlers.cpp - src/utils/LinphoneUtils.cpp - src/utils/MediastreamerUtils.cpp - src/utils/QExifImageHeader.cpp - src/utils/Utils.cpp - ) + message("MINIZIP : ${MINIZIP_INCLUDE_DIRS} => ${MINIZIP_LIBRARIES}") + message("INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} FRAMEWORK_PATH=${CMAKE_FRAMEWORK_PATH}") + message("LINPHONE : ${LINPHONE_INCLUDE_DIRS} => ${LINPHONE_LIBRARIES}") + message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") - set(HEADERS - src/app/App.hpp - src/app/AppController.hpp - src/app/cli/Cli.hpp - src/app/logger/Logger.hpp - src/app/paths/Paths.hpp - src/app/providers/AvatarProvider.hpp - src/app/providers/ImageProvider.hpp - src/app/providers/ThumbnailProvider.hpp - src/app/single-application/SingleApplication.hpp - src/app/translator/DefaultTranslator.hpp - src/components/assistant/AssistantModel.hpp - src/components/authentication/AuthenticationNotifier.hpp - src/components/call/CallModel.hpp - src/components/calls/CallsListModel.hpp - src/components/calls/CallsListProxyModel.hpp - src/components/camera/Camera.hpp - src/components/camera/CameraPreview.hpp - src/components/camera/MSFunctions.hpp - src/components/chat/ChatModel.hpp - src/components/chat/ChatProxyModel.hpp - src/components/codecs/AbstractCodecsModel.hpp - src/components/codecs/AudioCodecsModel.hpp - src/components/codecs/VideoCodecsModel.hpp - src/components/Components.hpp - src/components/conference/ConferenceAddModel.hpp - src/components/conference/ConferenceHelperModel.hpp - src/components/conference/ConferenceModel.hpp - src/components/contact/ContactModel.hpp - src/components/contact/VcardModel.hpp - src/components/contacts/ContactsListModel.hpp - src/components/contacts/ContactsListProxyModel.hpp - src/components/core/CoreHandlers.hpp - src/components/core/CoreManager.hpp - src/components/core/event-count-notifier/AbstractEventCountNotifier.hpp - src/components/file/FileDownloader.hpp - src/components/file/FileExtractor.hpp - src/components/notifier/Notifier.hpp - src/components/other/clipboard/Clipboard.hpp - src/components/other/colors/Colors.hpp - src/components/other/desktop-tools/DesktopTools.hpp - src/components/other/text-to-speech/TextToSpeech.hpp - src/components/other/units/Units.hpp - src/components/presence/OwnPresenceModel.hpp - src/components/presence/Presence.hpp - src/components/settings/AccountSettingsModel.hpp - src/components/settings/SettingsModel.hpp - src/components/sip-addresses/SipAddressesModel.hpp - src/components/sip-addresses/SipAddressesProxyModel.hpp - src/components/sip-addresses/SipAddressObserver.hpp - src/components/sound-player/SoundPlayer.hpp - src/components/telephone-numbers/TelephoneNumbersModel.hpp - src/components/timeline/TimelineModel.hpp - src/components/url-handlers/UrlHandlers.hpp - src/utils/LinphoneUtils.hpp - src/utils/MediastreamerUtils.hpp - src/utils/QExifImageHeader.hpp - src/utils/Utils.hpp - ) + # Build configuration + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -DQT_NO_DEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG") + if( WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WINSOCKAPI_")#remove error from windows headers order + endif() + set(CMAKE_INCLUDE_CURRENT_DIR ON)#useful for config.h - set(MAIN_FILE src/app/main.cpp) + set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network) + if (UNIX AND NOT APPLE) + list(APPEND QT5_PACKAGES DBus) + endif () + set(QT5_PACKAGES_OPTIONAL TextToSpeech) + set(CMAKE_AUTOMOC ON) + #------------------------------------------------- + set(ASSETS_DIR "assets") + set(SOURCES + src/app/App.cpp + src/app/AppController.cpp + src/app/cli/Cli.cpp + src/app/logger/Logger.cpp + src/app/paths/Paths.cpp + src/app/providers/AvatarProvider.cpp + src/app/providers/ImageProvider.cpp + src/app/providers/ThumbnailProvider.cpp + src/app/translator/DefaultTranslator.cpp + src/components/assistant/AssistantModel.cpp + src/components/authentication/AuthenticationNotifier.cpp + src/components/call/CallModel.cpp + src/components/calls/CallsListModel.cpp + src/components/calls/CallsListProxyModel.cpp + src/components/camera/Camera.cpp + src/components/camera/CameraPreview.cpp + src/components/camera/MSFunctions.cpp + src/components/chat/ChatModel.cpp + src/components/chat/ChatProxyModel.cpp + src/components/codecs/AbstractCodecsModel.cpp + src/components/codecs/AudioCodecsModel.cpp + src/components/codecs/VideoCodecsModel.cpp + src/components/conference/ConferenceAddModel.cpp + src/components/conference/ConferenceHelperModel.cpp + src/components/conference/ConferenceModel.cpp + src/components/contact/ContactModel.cpp + src/components/contact/VcardModel.cpp + src/components/contacts/ContactsListModel.cpp + src/components/contacts/ContactsListProxyModel.cpp + src/components/core/CoreHandlers.cpp + src/components/core/CoreManager.cpp + src/components/core/event-count-notifier/AbstractEventCountNotifier.cpp + src/components/file/FileDownloader.cpp + src/components/file/FileExtractor.cpp + src/components/notifier/Notifier.cpp + src/components/other/clipboard/Clipboard.cpp + src/components/other/colors/Colors.cpp + src/components/other/text-to-speech/TextToSpeech.cpp + src/components/other/units/Units.cpp + src/components/presence/OwnPresenceModel.cpp + src/components/presence/Presence.cpp + src/components/settings/AccountSettingsModel.cpp + src/components/settings/SettingsModel.cpp + src/components/sip-addresses/SipAddressesModel.cpp + src/components/sip-addresses/SipAddressesProxyModel.cpp + src/components/sip-addresses/SipAddressObserver.cpp + src/components/sound-player/SoundPlayer.cpp + src/components/telephone-numbers/TelephoneNumbersModel.cpp + src/components/timeline/TimelineModel.cpp + src/components/url-handlers/UrlHandlers.cpp + src/utils/LinphoneUtils.cpp + src/utils/MediastreamerUtils.cpp + src/utils/QExifImageHeader.cpp + src/utils/Utils.cpp + ) - if (APPLE) - list(APPEND SOURCES - src/app/single-application/SingleApplication.cpp - src/components/core/event-count-notifier/EventCountNotifierMacOs.m - src/components/other/desktop-tools/DesktopToolsMacOs.cpp - src/components/other/desktop-tools/screen-saver/ScreenSaverMacOs.m - src/components/other/desktop-tools/state-process/StateProcessMacOs.mm - ) - list(APPEND HEADERS - src/app/single-application/SingleApplicationPrivate.hpp - src/components/core/event-count-notifier/EventCountNotifierMacOs.hpp - src/components/other/desktop-tools/DesktopToolsMacOs.hpp - ) - elseif (WIN32) - list(APPEND SOURCES - src/app/single-application/SingleApplication.cpp - src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.cpp - src/components/other/desktop-tools/DesktopToolsWindows.cpp - ) - list(APPEND HEADERS - src/app/single-application/SingleApplicationPrivate.hpp - src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.hpp - src/components/other/desktop-tools/DesktopToolsWindows.hpp - ) - else () - list(APPEND SOURCES - src/app/single-application/SingleApplicationDBus.cpp - src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.cpp - src/components/other/desktop-tools/DesktopToolsLinux.cpp - src/components/other/desktop-tools/screen-saver/ScreenSaverDBus.cpp - src/components/other/desktop-tools/screen-saver/ScreenSaverXdg.cpp - ) - list(APPEND HEADERS - src/app/single-application/SingleApplicationDBusPrivate.hpp - src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.hpp - src/components/other/desktop-tools/DesktopToolsLinux.hpp - src/components/other/desktop-tools/screen-saver/ScreenSaverDBus.hpp - src/components/other/desktop-tools/screen-saver/ScreenSaverXdg.hpp - ) - endif () + set(HEADERS + src/app/App.hpp + src/app/AppController.hpp + src/app/cli/Cli.hpp + src/app/logger/Logger.hpp + src/app/paths/Paths.hpp + src/app/providers/AvatarProvider.hpp + src/app/providers/ImageProvider.hpp + src/app/providers/ThumbnailProvider.hpp + src/app/single-application/SingleApplication.hpp + src/app/translator/DefaultTranslator.hpp + src/components/assistant/AssistantModel.hpp + src/components/authentication/AuthenticationNotifier.hpp + src/components/call/CallModel.hpp + src/components/calls/CallsListModel.hpp + src/components/calls/CallsListProxyModel.hpp + src/components/camera/Camera.hpp + src/components/camera/CameraPreview.hpp + src/components/camera/MSFunctions.hpp + src/components/chat/ChatModel.hpp + src/components/chat/ChatProxyModel.hpp + src/components/codecs/AbstractCodecsModel.hpp + src/components/codecs/AudioCodecsModel.hpp + src/components/codecs/VideoCodecsModel.hpp + src/components/Components.hpp + src/components/conference/ConferenceAddModel.hpp + src/components/conference/ConferenceHelperModel.hpp + src/components/conference/ConferenceModel.hpp + src/components/contact/ContactModel.hpp + src/components/contact/VcardModel.hpp + src/components/contacts/ContactsListModel.hpp + src/components/contacts/ContactsListProxyModel.hpp + src/components/core/CoreHandlers.hpp + src/components/core/CoreManager.hpp + src/components/core/event-count-notifier/AbstractEventCountNotifier.hpp + src/components/file/FileDownloader.hpp + src/components/file/FileExtractor.hpp + src/components/notifier/Notifier.hpp + src/components/other/clipboard/Clipboard.hpp + src/components/other/colors/Colors.hpp + src/components/other/desktop-tools/DesktopTools.hpp + src/components/other/text-to-speech/TextToSpeech.hpp + src/components/other/units/Units.hpp + src/components/presence/OwnPresenceModel.hpp + src/components/presence/Presence.hpp + src/components/settings/AccountSettingsModel.hpp + src/components/settings/SettingsModel.hpp + src/components/sip-addresses/SipAddressesModel.hpp + src/components/sip-addresses/SipAddressesProxyModel.hpp + src/components/sip-addresses/SipAddressObserver.hpp + src/components/sound-player/SoundPlayer.hpp + src/components/telephone-numbers/TelephoneNumbersModel.hpp + src/components/timeline/TimelineModel.hpp + src/components/url-handlers/UrlHandlers.hpp + src/utils/LinphoneUtils.hpp + src/utils/MediastreamerUtils.hpp + src/utils/QExifImageHeader.hpp + src/utils/Utils.hpp + ) - set(QRC_RESOURCES resources.qrc) + set(MAIN_FILE src/app/main.cpp) - set(LANGUAGES_DIRECTORY "${ASSETS_DIR}/languages") - set(I18N_FILENAME i18n.qrc) - set(LANGUAGES de en fr_FR ja lt ru sv tr pt_BR) + if (APPLE) + list(APPEND SOURCES + src/app/single-application/SingleApplication.cpp + src/components/core/event-count-notifier/EventCountNotifierMacOs.m + src/components/other/desktop-tools/DesktopToolsMacOs.cpp + src/components/other/desktop-tools/screen-saver/ScreenSaverMacOs.m + src/components/other/desktop-tools/state-process/StateProcessMacOs.mm + ) + list(APPEND HEADERS + src/app/single-application/SingleApplicationPrivate.hpp + src/components/core/event-count-notifier/EventCountNotifierMacOs.hpp + src/components/other/desktop-tools/DesktopToolsMacOs.hpp + ) + elseif (WIN32) + list(APPEND SOURCES + src/app/single-application/SingleApplication.cpp + src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.cpp + src/components/other/desktop-tools/DesktopToolsWindows.cpp + ) + list(APPEND HEADERS + src/app/single-application/SingleApplicationPrivate.hpp + src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.hpp + src/components/other/desktop-tools/DesktopToolsWindows.hpp + ) + else () + list(APPEND SOURCES + src/app/single-application/SingleApplicationDBus.cpp + src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.cpp + src/components/other/desktop-tools/DesktopToolsLinux.cpp + src/components/other/desktop-tools/screen-saver/ScreenSaverDBus.cpp + src/components/other/desktop-tools/screen-saver/ScreenSaverXdg.cpp + ) + list(APPEND HEADERS + src/app/single-application/SingleApplicationDBusPrivate.hpp + src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.hpp + src/components/other/desktop-tools/DesktopToolsLinux.hpp + src/components/other/desktop-tools/screen-saver/ScreenSaverDBus.hpp + src/components/other/desktop-tools/screen-saver/ScreenSaverXdg.hpp + ) + endif () - # ------------------------------------------------------------------------------ + set(QRC_RESOURCES resources.qrc) - function (PREPEND list prefix) - set(new_list "") + set(LANGUAGES_DIRECTORY "${ASSETS_DIR}/languages") + set(I18N_FILENAME i18n.qrc) + set(LANGUAGES de en fr_FR ja lt ru sv tr pt_BR) - foreach (elem ${${list}}) - list(APPEND new_list "${prefix}${elem}") - endforeach () + # ------------------------------------------------------------------------------ - set(${list} ${new_list} PARENT_SCOPE) - endfunction () + function (PREPEND list prefix) + set(new_list "") - # Force absolute paths. - PREPEND(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/") - PREPEND(HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/") + foreach (elem ${${list}}) + list(APPEND new_list "${prefix}${elem}") + endforeach () - # ------------------------------------------------------------------------------ - # Compute QML files list. - # ------------------------------------------------------------------------------ + set(${list} ${new_list} PARENT_SCOPE) + endfunction () - set(QML_SOURCES) - file(STRINGS ${QRC_RESOURCES} QRC_RESOURCES_CONTENT) - foreach (line ${QRC_RESOURCES_CONTENT}) - set(result) - string(REGEX REPLACE - "^[ \t]*<[ \t]*file[ \t]*>[ \t]*(.+\\.[a-z]+)[ \t]*<[ \t]*/[ \t]*file[ \t]*>[ \t]*$" - "\\1" - result - "${line}" - ) - string(REGEX MATCH "\\.[a-z]+$" is_ui ${result}) - if (NOT ${is_ui} STREQUAL "") - list(APPEND QML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${result}") - endif () - endforeach () + # Force absolute paths. + PREPEND(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/") + PREPEND(HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/") - # ------------------------------------------------------------------------------ - # Init git hooks. - # ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ + # Compute QML files list. + # ------------------------------------------------------------------------------ - if (NOT WIN32) - add_custom_target( - check_qml DEPENDS ${QML_SOURCES} - COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/check_qml_syntax" - ) - endif() + set(QML_SOURCES) + file(STRINGS ${QRC_RESOURCES} QRC_RESOURCES_CONTENT) + foreach (line ${QRC_RESOURCES_CONTENT}) + set(result) + string(REGEX REPLACE + "^[ \t]*<[ \t]*file[ \t]*>[ \t]*(.+\\.[a-z]+)[ \t]*<[ \t]*/[ \t]*file[ \t]*>[ \t]*$" + "\\1" + result + "${line}" + ) + string(REGEX MATCH "\\.[a-z]+$" is_ui ${result}) + if (NOT ${is_ui} STREQUAL "") + list(APPEND QML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${result}") + endif () + endforeach () - execute_process(COMMAND ${CMAKE_COMMAND} -E copy - "${CMAKE_CURRENT_SOURCE_DIR}/tools/private/pre-commit" - "${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit" - ) - set(_QML_IMPORT_PATHS "") - list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/modules") - list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/dev-modules") - list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/scripts") - list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/views") + # ------------------------------------------------------------------------------ + # Init git hooks. + # ------------------------------------------------------------------------------ + + if (NOT WIN32) + add_custom_target( + check_qml DEPENDS ${QML_SOURCES} + COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/check_qml_syntax" + ) + endif() + + execute_process(COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/tools/private/pre-commit" + "${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit" + ) + set(_QML_IMPORT_PATHS "") + list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/modules") + list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/dev-modules") + list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/scripts") + list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/views") - set(QML_IMPORT_PATH ${_QML_IMPORT_PATHS} CACHE STRING "Path used to locate CMake modules by Qt Creator" FORCE) + set(QML_IMPORT_PATH ${_QML_IMPORT_PATHS} CACHE STRING "Path used to locate CMake modules by Qt Creator" FORCE) -if(APPLE) - if(MS2_PLUGINS_LOCATION) - set(MSPLUGINS_DIR ${MS2_PLUGINS_LOCATION}) - else() - set(MSPLUGINS_DIR "Frameworks/mediastreamer2.framework/Versions/A/Libraries") - endif() -else() - set(MSPLUGINS_DIR "${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins") -endif() - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h") - # ------------------------------------------------------------------------------ - # Build. - # ------------------------------------------------------------------------------ + if(APPLE) + if(MS2_PLUGINS_LOCATION) + set(MSPLUGINS_DIR ${MS2_PLUGINS_LOCATION}) + else() + set(MSPLUGINS_DIR "Frameworks/mediastreamer2.framework/Versions/A/Libraries") + endif() + else() + set(MSPLUGINS_DIR "${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins") + endif() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h") + # ------------------------------------------------------------------------------ + # Build. + # ------------------------------------------------------------------------------ - include_directories(src/) + include_directories(src/) - find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED) - find_package(Qt5 COMPONENTS ${QT5_PACKAGES_OPTIONAL} QUIET) + find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED) + find_package(Qt5 COMPONENTS ${QT5_PACKAGES_OPTIONAL} QUIET) - if (CMAKE_INSTALL_RPATH) - #Retrieve lib path from a know QT executable - get_target_property(LUPDATE_PATH Qt5::lupdate LOCATION) - get_filename_component(LUPDATE_PATH "${LUPDATE_PATH}" DIRECTORY) - get_filename_component(QT_PATH "${LUPDATE_PATH}/../lib" ABSOLUTE) - list(APPEND CMAKE_INSTALL_RPATH "${QT_PATH}") - endif () - # Add languages support. - add_subdirectory(${LANGUAGES_DIRECTORY}) + if (CMAKE_INSTALL_RPATH) + #Retrieve lib path from a know QT executable + get_target_property(LUPDATE_PATH Qt5::lupdate LOCATION) + get_filename_component(LUPDATE_PATH "${LUPDATE_PATH}" DIRECTORY) + get_filename_component(QT_PATH "${LUPDATE_PATH}/../lib" ABSOLUTE) + list(APPEND CMAKE_INSTALL_RPATH "${QT_PATH}") + endif () + # Add languages support. + add_subdirectory(${LANGUAGES_DIRECTORY}) - list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_FILENAME}") + list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_FILENAME}") - # Build. - #add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${RESOURCES} ${QML_SOURCES}) - add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${QML_SOURCES} ${QRC_RESOURCES}) - set_property(TARGET ${APP_LIBRARY} PROPERTY POSITION_INDEPENDENT_CODE ON) + # Build. + #add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${RESOURCES} ${QML_SOURCES}) + add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${QML_SOURCES} ${QRC_RESOURCES}) + set_property(TARGET ${APP_LIBRARY} PROPERTY POSITION_INDEPENDENT_CODE ON) - #Turn on automatic resources compilation by cmake - #Instead of excplicitely calling qt5_add_resources - set_property(TARGET ${APP_LIBRARY} PROPERTY AUTORCC ON) + #Turn on automatic resources compilation by cmake + #Instead of excplicitely calling qt5_add_resources + set_property(TARGET ${APP_LIBRARY} PROPERTY AUTORCC ON) - bc_git_version(${TARGET_NAME} ${PROJECT_VERSION}) - add_dependencies(${APP_LIBRARY} ${TARGET_NAME}-git-version) - add_dependencies(${APP_LIBRARY} update_translations) - if (WIN32) - add_executable(${TARGET_NAME} WIN32 $ ${ASSETS_DIR}/app-icon.rc ${MAIN_FILE}) - else () - add_executable(${TARGET_NAME} $ ${MAIN_FILE}) - endif () + bc_git_version(${TARGET_NAME} ${PROJECT_VERSION}) + add_dependencies(${APP_LIBRARY} ${TARGET_NAME}-git-version) + add_dependencies(${APP_LIBRARY} update_translations) + if (WIN32) + add_executable(${TARGET_NAME} WIN32 $ ${ASSETS_DIR}/app-icon.rc ${MAIN_FILE}) + else () + add_executable(${TARGET_NAME} $ ${MAIN_FILE}) + endif () - set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}") - set(INCLUDED_DIRECTORIES "${LINPHONECXX_INCLUDE_DIRS}" "${LINPHONE_INCLUDE_DIRS}" "${BELCARD_INCLUDE_DIRS}" "${BCTOOLBOX_INCLUDE_DIRS}" "${MEDIASTREAMER2_INCLUDE_DIRS}" "${MINIZIP_INCLUDE_DIRS}") - set(LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BELCARD_LIBRARIES} ${LINPHONE_LIBRARIES} ${LINPHONECXX_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES} ${OPUS_LIBRARIES}) - if(WIN32) - list(APPEND LIBRARIES ${MINIZIP_LIBRARIES}) - endif() - foreach (package ${QT5_PACKAGES}) - list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}") - # `qt5_create_translation` is provided from `LinguistTools` package. - # But the `Qt5::LinguistTools` lib does not exist. Remove it. - if (NOT (${package} STREQUAL LinguistTools)) - list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES}) - endif () - endforeach () + set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}") + set(INCLUDED_DIRECTORIES "${LINPHONECXX_INCLUDE_DIRS}" "${LINPHONE_INCLUDE_DIRS}" "${BELCARD_INCLUDE_DIRS}" "${BCTOOLBOX_INCLUDE_DIRS}" "${MEDIASTREAMER2_INCLUDE_DIRS}" "${MINIZIP_INCLUDE_DIRS}") + set(LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BELCARD_LIBRARIES} ${LINPHONE_LIBRARIES} ${LINPHONECXX_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES} ${OPUS_LIBRARIES}) + if(WIN32) + list(APPEND LIBRARIES ${MINIZIP_LIBRARIES}) + endif() + foreach (package ${QT5_PACKAGES}) + list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}") + # `qt5_create_translation` is provided from `LinguistTools` package. + # But the `Qt5::LinguistTools` lib does not exist. Remove it. + if (NOT (${package} STREQUAL LinguistTools)) + list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES}) + endif () + endforeach () - foreach (package ${QT5_PACKAGES_OPTIONAL}) - if ("${Qt5${package}_FOUND}") - message("Optional package ${package} found.") - list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}") - list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES}) + foreach (package ${QT5_PACKAGES_OPTIONAL}) + if ("${Qt5${package}_FOUND}") + message("Optional package ${package} found.") + list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}") + list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES}) - string(TOUPPER "${package}" INCLUDE_NAME) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${INCLUDE_NAME}_ENABLED") - else () - message("Optional package ${package} not found.") - endif () - endforeach () + string(TOUPPER "${package}" INCLUDE_NAME) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${INCLUDE_NAME}_ENABLED") + else () + message("Optional package ${package} not found.") + endif () + endforeach () - if (APPLE) - list(APPEND LIBRARIES "-framework Cocoa -framework IOKit") - # -framework linphone") #This doesn't work yet - endif () - target_include_directories(${APP_LIBRARY} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES}) - target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES}) + if (APPLE) + list(APPEND LIBRARIES "-framework Cocoa -framework IOKit") + # -framework linphone") #This doesn't work yet + endif () + target_include_directories(${APP_LIBRARY} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES}) + target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES}) - target_link_libraries(${TARGET_NAME} ${LIBRARIES}) - if(WIN32) - target_link_libraries(${TARGET_NAME} wsock32 ws2_32) - endif() + target_link_libraries(${TARGET_NAME} ${LIBRARIES}) + if(WIN32) + target_link_libraries(${TARGET_NAME} wsock32 ws2_32) + endif() - foreach (target ${TARGET_NAME}) - install(TARGETS ${target} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - ) - endforeach () + foreach (target ${TARGET_NAME}) + install(TARGETS ${target} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + endforeach () - if (UNIX AND NOT APPLE) - # Install desktop/icon files. - configure_file("${ASSETS_DIR}/linphone.desktop.cmake" "${EXECUTABLE_NAME}.desktop" @ONLY) + if (UNIX AND NOT APPLE) + # Install desktop/icon files. + configure_file("${ASSETS_DIR}/linphone.desktop.cmake" "${EXECUTABLE_NAME}.desktop" @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}.desktop" - DESTINATION "${CMAKE_INSTALL_DATADIR}/applications" - ) - install(FILES "${ASSETS_DIR}/images/linphone_logo.svg" - DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps/" - RENAME "${EXECUTABLE_NAME}.svg" - ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}.desktop" + DESTINATION "${CMAKE_INSTALL_DATADIR}/applications" + ) + install(FILES "${ASSETS_DIR}/images/linphone_logo.svg" + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps/" + RENAME "${EXECUTABLE_NAME}.svg" + ) - set(ICON_DIRS 16x16 22x22 24x24 32x32 64x64 128x128 256x256) - foreach (DIR ${ICON_DIRS}) - install(FILES "${ASSETS_DIR}/icons/hicolor/${DIR}/apps/icon.png" - DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${DIR}/apps/" - RENAME "${EXECUTABLE_NAME}.png" - ) - endforeach () - endif () + set(ICON_DIRS 16x16 22x22 24x24 32x32 64x64 128x128 256x256) + foreach (DIR ${ICON_DIRS}) + install(FILES "${ASSETS_DIR}/icons/hicolor/${DIR}/apps/icon.png" + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${DIR}/apps/" + RENAME "${EXECUTABLE_NAME}.png" + ) + endforeach () + endif () - # ------------------------------------------------------------------------------ - # Install rc files. - # ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ + # Install rc files. + # ------------------------------------------------------------------------------ - install(FILES "${ASSETS_DIR}/linphonerc-factory" - DESTINATION "${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}" - ) + install(FILES "${ASSETS_DIR}/linphonerc-factory" + DESTINATION "${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}" + ) - set(ASSETS_ASSISTANT_DIR "${ASSETS_DIR}/assistant") - set(ASSISTANT_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}/assistant") + set(ASSETS_ASSISTANT_DIR "${ASSETS_DIR}/assistant") + set(ASSISTANT_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}/assistant") - install(FILES "${ASSETS_ASSISTANT_DIR}/use-other-sip-account.rc" - DESTINATION "${ASSISTANT_INSTALL_DATADIR}" - ) - install(FILES "${ASSETS_ASSISTANT_DIR}/create-app-sip-account.rc" - DESTINATION "${ASSISTANT_INSTALL_DATADIR}" - ) - install(FILES "${ASSETS_ASSISTANT_DIR}/use-app-sip-account.rc" - DESTINATION "${ASSISTANT_INSTALL_DATADIR}" - ) + install(FILES "${ASSETS_ASSISTANT_DIR}/use-other-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}" + ) + install(FILES "${ASSETS_ASSISTANT_DIR}/create-app-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}" + ) + install(FILES "${ASSETS_ASSISTANT_DIR}/use-app-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}" + ) - # ------------------------------------------------------------------------------ - # CPack settings & RPM. - # ------------------------------------------------------------------------------ - set(LINPHONE_DESKTOP_DIR "${CMAKE_SOURCE_DIR}") - set(LINPHONE_OUTPUT_DIR "${CMAKE_INSTALL_PREFIX}") - set(LINPHONE_SDK_DIR "${CMAKE_BINARY_DIR}/linphone-sdk") - set(TOOLS_DIR "${CMAKE_BINARY_DIR}/programs") - set(LINPHONE_SOURCE_DIR ${EP_linphone_SOURCE_DIR}) - set(LINPHONE_BUILDER_SIGNING_IDENTITY ${LINPHONE_BUILDER_SIGNING_IDENTITY}) - set(LINPHONE_SDK_TMP "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-tmp") + # ------------------------------------------------------------------------------ + # CPack settings & RPM. + # ------------------------------------------------------------------------------ + set(LINPHONE_DESKTOP_DIR "${CMAKE_SOURCE_DIR}") + set(LINPHONE_OUTPUT_DIR "${CMAKE_INSTALL_PREFIX}") + set(LINPHONE_SDK_DIR "${CMAKE_BINARY_DIR}/linphone-sdk") + set(TOOLS_DIR "${CMAKE_BINARY_DIR}/programs") + set(LINPHONE_SOURCE_DIR ${EP_linphone_SOURCE_DIR}) + set(LINPHONE_BUILDER_SIGNING_IDENTITY ${LINPHONE_BUILDER_SIGNING_IDENTITY}) + set(LINPHONE_SDK_TMP "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-tmp") - add_subdirectory(build) - add_subdirectory(cmake_builder/linphone_package) + add_subdirectory(build) + add_subdirectory(cmake_builder/linphone_package) - # ------------------------------------------------------------------------------ - # To start better integration into IDE. - # ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ + # To start better integration into IDE. + # ------------------------------------------------------------------------------ - source_group( - "Qml" REGULAR_EXPRESSION ".+\.qml$" - ) - source_group( - "Js" REGULAR_EXPRESSION ".+\.js$" - ) - source_group( - "Svg" REGULAR_EXPRESSION ".+\.svg$" - ) + source_group( + "Qml" REGULAR_EXPRESSION ".+\.qml$" + ) + source_group( + "Js" REGULAR_EXPRESSION ".+\.js$" + ) + source_group( + "Svg" REGULAR_EXPRESSION ".+\.svg$" + ) - # ------------------------------ - # Installation - # ------------------------------ - install(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake_builder/install.cmake") - #endif () + # ------------------------------ + # Installation + # ------------------------------ + install(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake_builder/install.cmake") + #endif () - if(APPLE) - target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib/libminizip.dylib") - elseif(NOT WIN32) - if( EXISTS "${CMAKE_INSTALL_PREFIX}/lib64/libminizip.so") - target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib64/libminizip.so") - elseif(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libminizip.so") - target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib/libminizip.so") - else() - message("Error cannot find ${CMAKE_INSTALL_PREFIX}/lib*/libminizip.so while linking") - endif() - endif() + if(APPLE) + target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib/libminizip.dylib") + elseif(NOT WIN32) + if( EXISTS "${CMAKE_INSTALL_PREFIX}/lib64/libminizip.so") + target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib64/libminizip.so") + elseif(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libminizip.so") + target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib/libminizip.so") + else() + message("Error cannot find ${CMAKE_INSTALL_PREFIX}/lib*/libminizip.so while linking") + endif() + endif() endif()#If (LinphoneCxx_FOUND AND Minizip_FOUND) -endif()#If (LinphoneCxx_FOUND) \ No newline at end of file +endif()#If (LinphoneCxx_FOUND) diff --git a/cmake_builder/linphone_package/CMakeLists.txt b/cmake_builder/linphone_package/CMakeLists.txt index 3be42fe8f..67fc91ff0 100644 --- a/cmake_builder/linphone_package/CMakeLists.txt +++ b/cmake_builder/linphone_package/CMakeLists.txt @@ -144,23 +144,24 @@ foreach (FILE ${LIST_FILES}) file(APPEND "${LINPHONE_SDK_TMP}/${EXECUTABLE_NAME}-sdk.list" "${CONTENT}\n") endforeach () -if (WIN32) - find_program(7Z_PROGRAM 7z PATHS "$ENV{ProgramFiles}/7-Zip") - if (7Z_PROGRAM) - execute_process( - COMMAND ${7Z_PROGRAM} a -tzip ${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-win32.zip "@${EXECUTABLE_NAME}-sdk.list" - WORKING_DIRECTORY ${LINPHONE_SDK_TMP} - ) - else () - message(WARNING "7z has not been found, cannot generate the SDK!") - endif () -elseif (APPLE) - execute_process( - COMMAND rm -rf "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-mac.zip" - COMMAND zip -ry "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-mac.zip" . -i "@${EXECUTABLE_NAME}-sdk.list" - WORKING_DIRECTORY ${LINPHONE_SDK_TMP} - ) -endif () +# Removed unless it is usefull to get a zip from SDK : The SDK is packaged with binaries. +#if (WIN32) +# find_program(7Z_PROGRAM 7z PATHS "$ENV{ProgramFiles}/7-Zip") +# if (7Z_PROGRAM) +# execute_process( +# COMMAND ${7Z_PROGRAM} a -tzip ${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-win32.zip "@${EXECUTABLE_NAME}-sdk.list" +# WORKING_DIRECTORY ${LINPHONE_SDK_TMP} +# ) +# else () +# message(WARNING "7z has not been found, cannot generate the SDK!") +# endif () +#elseif (APPLE) +# execute_process( +# COMMAND rm -rf "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-mac.zip" +# COMMAND zip -ry "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-mac.zip" . -i "@${EXECUTABLE_NAME}-sdk.list" +# WORKING_DIRECTORY ${LINPHONE_SDK_TMP} +# ) +#endif () # ============================================================================== # Specific deployment. diff --git a/linphone-sdk b/linphone-sdk index 471ecaa3d..0afeab621 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 471ecaa3d6e9af94caf24e1427704b8de5537ed6 +Subproject commit 0afeab62189ccf8dc5d9a8dace2968efc53bf60a From 264e9f99f907b81aaaf13dd7d546c3c0fa4084a7 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 21 Feb 2020 19:09:07 +0100 Subject: [PATCH 09/11] Clean installation --- CMakeLists.txt | 795 +++++++++--------- cmake_builder/install.cmake | 4 +- cmake_builder/linphone_package/CMakeLists.txt | 192 ++--- 3 files changed, 457 insertions(+), 534 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b5e12b67..618b2a811 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,9 +29,16 @@ cmake_minimum_required(VERSION 3.1) project(linphoneqt VERSION 4.1.1) # Prepare gobal CMAKE configuration specific to the current project -list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}/linphone-sdk/desktop;${CMAKE_BINARY_DIR}/OUTPUT") -message("${CMAKE_PREFIX_PATH}") -set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/OUTPUT") +set(SDK_BUILD_DIR "${CMAKE_BINARY_DIR}/WORK") # SDK build in WORK. Keep all in it. +set(LINPHONE_OUTPUT_DIR "${CMAKE_BINARY_DIR}/linphone-sdk/desktop") #This is fixed by the SDK +set(MINIZIP_OUTPUT_DIR "${CMAKE_BINARY_DIR}/minizip_OUTPUT") + +set(APPLICATION_OUTPUT_DIR "${CMAKE_BINARY_DIR}/OUTPUT") + +message("minizip=${MINIZIP_OUTPUT_DIR} sdk=${LINPHONE_OUTPUT_DIR}") + +list(APPEND CMAKE_PREFIX_PATH "${LINPHONE_OUTPUT_DIR};${MINIZIP_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR}") + if(UNIX AND NOT APPLE) set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/lib64;$ORIGIN/../lib64;$ORIGIN/lib;$ORIGIN/../lib") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) @@ -87,447 +94,447 @@ find_package(ortp CONFIG) if( NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND)) message("Linphone packages are not installed. Build and install it in order to build Minizip and then Desktop Application.") - add_subdirectory("linphone-sdk" "linphone-sdk/build-sdk") + set(CMAKE_INSTALL_PREFIX "${LINPHONE_OUTPUT_DIR}") + add_subdirectory("linphone-sdk" "${SDK_BUILD_DIR}") else() # Linphone SDK has been builded message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") find_package(Minizip) if( NOT(Minizip_FOUND)) - message("Minizip are not installed. Build and install it in order to build Desktop Application.") - add_subdirectory(submodules/externals/minizip "submodules/externals/minizip/build-minizip") + message("Minizip are not installed. Build and install it in order to build Desktop Application.") + set(CMAKE_INSTALL_PREFIX "${MINIZIP_OUTPUT_DIR}") + add_subdirectory(submodules/externals/minizip "submodules/externals/minizip/build-minizip") else() - message("MINIZIP : ${MINIZIP_INCLUDE_DIRS} => ${MINIZIP_LIBRARIES}") - message("INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} FRAMEWORK_PATH=${CMAKE_FRAMEWORK_PATH}") - message("LINPHONE : ${LINPHONE_INCLUDE_DIRS} => ${LINPHONE_LIBRARIES}") - message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") + set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") + message("MINIZIP : ${MINIZIP_INCLUDE_DIRS} => ${MINIZIP_LIBRARIES}") + message("INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} FRAMEWORK_PATH=${CMAKE_FRAMEWORK_PATH}") + message("LINPHONE : ${LINPHONE_INCLUDE_DIRS} => ${LINPHONE_LIBRARIES}") + message("LINPHONECXX : ${LINPHONECXX_INCLUDE_DIRS} => ${LINPHONECXX_LIBRARIES}") - # Build configuration - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -DQT_NO_DEBUG") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG") - if( WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WINSOCKAPI_")#remove error from windows headers order - endif() - set(CMAKE_INCLUDE_CURRENT_DIR ON)#useful for config.h + # Build configuration + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -DQT_NO_DEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG") + if( WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WINSOCKAPI_")#remove error from windows headers order + endif() + set(CMAKE_INCLUDE_CURRENT_DIR ON)#useful for config.h - set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network) - if (UNIX AND NOT APPLE) - list(APPEND QT5_PACKAGES DBus) - endif () - set(QT5_PACKAGES_OPTIONAL TextToSpeech) - set(CMAKE_AUTOMOC ON) - #------------------------------------------------- - set(ASSETS_DIR "assets") - set(SOURCES - src/app/App.cpp - src/app/AppController.cpp - src/app/cli/Cli.cpp - src/app/logger/Logger.cpp - src/app/paths/Paths.cpp - src/app/providers/AvatarProvider.cpp - src/app/providers/ImageProvider.cpp - src/app/providers/ThumbnailProvider.cpp - src/app/translator/DefaultTranslator.cpp - src/components/assistant/AssistantModel.cpp - src/components/authentication/AuthenticationNotifier.cpp - src/components/call/CallModel.cpp - src/components/calls/CallsListModel.cpp - src/components/calls/CallsListProxyModel.cpp - src/components/camera/Camera.cpp - src/components/camera/CameraPreview.cpp - src/components/camera/MSFunctions.cpp - src/components/chat/ChatModel.cpp - src/components/chat/ChatProxyModel.cpp - src/components/codecs/AbstractCodecsModel.cpp - src/components/codecs/AudioCodecsModel.cpp - src/components/codecs/VideoCodecsModel.cpp - src/components/conference/ConferenceAddModel.cpp - src/components/conference/ConferenceHelperModel.cpp - src/components/conference/ConferenceModel.cpp - src/components/contact/ContactModel.cpp - src/components/contact/VcardModel.cpp - src/components/contacts/ContactsListModel.cpp - src/components/contacts/ContactsListProxyModel.cpp - src/components/core/CoreHandlers.cpp - src/components/core/CoreManager.cpp - src/components/core/event-count-notifier/AbstractEventCountNotifier.cpp - src/components/file/FileDownloader.cpp - src/components/file/FileExtractor.cpp - src/components/notifier/Notifier.cpp - src/components/other/clipboard/Clipboard.cpp - src/components/other/colors/Colors.cpp - src/components/other/text-to-speech/TextToSpeech.cpp - src/components/other/units/Units.cpp - src/components/presence/OwnPresenceModel.cpp - src/components/presence/Presence.cpp - src/components/settings/AccountSettingsModel.cpp - src/components/settings/SettingsModel.cpp - src/components/sip-addresses/SipAddressesModel.cpp - src/components/sip-addresses/SipAddressesProxyModel.cpp - src/components/sip-addresses/SipAddressObserver.cpp - src/components/sound-player/SoundPlayer.cpp - src/components/telephone-numbers/TelephoneNumbersModel.cpp - src/components/timeline/TimelineModel.cpp - src/components/url-handlers/UrlHandlers.cpp - src/utils/LinphoneUtils.cpp - src/utils/MediastreamerUtils.cpp - src/utils/QExifImageHeader.cpp - src/utils/Utils.cpp - ) + set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 Svg LinguistTools Concurrent Network) + if (UNIX AND NOT APPLE) + list(APPEND QT5_PACKAGES DBus) + endif () + set(QT5_PACKAGES_OPTIONAL TextToSpeech) + set(CMAKE_AUTOMOC ON) + #------------------------------------------------- + set(ASSETS_DIR "assets") + set(SOURCES + src/app/App.cpp + src/app/AppController.cpp + src/app/cli/Cli.cpp + src/app/logger/Logger.cpp + src/app/paths/Paths.cpp + src/app/providers/AvatarProvider.cpp + src/app/providers/ImageProvider.cpp + src/app/providers/ThumbnailProvider.cpp + src/app/translator/DefaultTranslator.cpp + src/components/assistant/AssistantModel.cpp + src/components/authentication/AuthenticationNotifier.cpp + src/components/call/CallModel.cpp + src/components/calls/CallsListModel.cpp + src/components/calls/CallsListProxyModel.cpp + src/components/camera/Camera.cpp + src/components/camera/CameraPreview.cpp + src/components/camera/MSFunctions.cpp + src/components/chat/ChatModel.cpp + src/components/chat/ChatProxyModel.cpp + src/components/codecs/AbstractCodecsModel.cpp + src/components/codecs/AudioCodecsModel.cpp + src/components/codecs/VideoCodecsModel.cpp + src/components/conference/ConferenceAddModel.cpp + src/components/conference/ConferenceHelperModel.cpp + src/components/conference/ConferenceModel.cpp + src/components/contact/ContactModel.cpp + src/components/contact/VcardModel.cpp + src/components/contacts/ContactsListModel.cpp + src/components/contacts/ContactsListProxyModel.cpp + src/components/core/CoreHandlers.cpp + src/components/core/CoreManager.cpp + src/components/core/event-count-notifier/AbstractEventCountNotifier.cpp + src/components/file/FileDownloader.cpp + src/components/file/FileExtractor.cpp + src/components/notifier/Notifier.cpp + src/components/other/clipboard/Clipboard.cpp + src/components/other/colors/Colors.cpp + src/components/other/text-to-speech/TextToSpeech.cpp + src/components/other/units/Units.cpp + src/components/presence/OwnPresenceModel.cpp + src/components/presence/Presence.cpp + src/components/settings/AccountSettingsModel.cpp + src/components/settings/SettingsModel.cpp + src/components/sip-addresses/SipAddressesModel.cpp + src/components/sip-addresses/SipAddressesProxyModel.cpp + src/components/sip-addresses/SipAddressObserver.cpp + src/components/sound-player/SoundPlayer.cpp + src/components/telephone-numbers/TelephoneNumbersModel.cpp + src/components/timeline/TimelineModel.cpp + src/components/url-handlers/UrlHandlers.cpp + src/utils/LinphoneUtils.cpp + src/utils/MediastreamerUtils.cpp + src/utils/QExifImageHeader.cpp + src/utils/Utils.cpp + ) - set(HEADERS - src/app/App.hpp - src/app/AppController.hpp - src/app/cli/Cli.hpp - src/app/logger/Logger.hpp - src/app/paths/Paths.hpp - src/app/providers/AvatarProvider.hpp - src/app/providers/ImageProvider.hpp - src/app/providers/ThumbnailProvider.hpp - src/app/single-application/SingleApplication.hpp - src/app/translator/DefaultTranslator.hpp - src/components/assistant/AssistantModel.hpp - src/components/authentication/AuthenticationNotifier.hpp - src/components/call/CallModel.hpp - src/components/calls/CallsListModel.hpp - src/components/calls/CallsListProxyModel.hpp - src/components/camera/Camera.hpp - src/components/camera/CameraPreview.hpp - src/components/camera/MSFunctions.hpp - src/components/chat/ChatModel.hpp - src/components/chat/ChatProxyModel.hpp - src/components/codecs/AbstractCodecsModel.hpp - src/components/codecs/AudioCodecsModel.hpp - src/components/codecs/VideoCodecsModel.hpp - src/components/Components.hpp - src/components/conference/ConferenceAddModel.hpp - src/components/conference/ConferenceHelperModel.hpp - src/components/conference/ConferenceModel.hpp - src/components/contact/ContactModel.hpp - src/components/contact/VcardModel.hpp - src/components/contacts/ContactsListModel.hpp - src/components/contacts/ContactsListProxyModel.hpp - src/components/core/CoreHandlers.hpp - src/components/core/CoreManager.hpp - src/components/core/event-count-notifier/AbstractEventCountNotifier.hpp - src/components/file/FileDownloader.hpp - src/components/file/FileExtractor.hpp - src/components/notifier/Notifier.hpp - src/components/other/clipboard/Clipboard.hpp - src/components/other/colors/Colors.hpp - src/components/other/desktop-tools/DesktopTools.hpp - src/components/other/text-to-speech/TextToSpeech.hpp - src/components/other/units/Units.hpp - src/components/presence/OwnPresenceModel.hpp - src/components/presence/Presence.hpp - src/components/settings/AccountSettingsModel.hpp - src/components/settings/SettingsModel.hpp - src/components/sip-addresses/SipAddressesModel.hpp - src/components/sip-addresses/SipAddressesProxyModel.hpp - src/components/sip-addresses/SipAddressObserver.hpp - src/components/sound-player/SoundPlayer.hpp - src/components/telephone-numbers/TelephoneNumbersModel.hpp - src/components/timeline/TimelineModel.hpp - src/components/url-handlers/UrlHandlers.hpp - src/utils/LinphoneUtils.hpp - src/utils/MediastreamerUtils.hpp - src/utils/QExifImageHeader.hpp - src/utils/Utils.hpp - ) + set(HEADERS + src/app/App.hpp + src/app/AppController.hpp + src/app/cli/Cli.hpp + src/app/logger/Logger.hpp + src/app/paths/Paths.hpp + src/app/providers/AvatarProvider.hpp + src/app/providers/ImageProvider.hpp + src/app/providers/ThumbnailProvider.hpp + src/app/single-application/SingleApplication.hpp + src/app/translator/DefaultTranslator.hpp + src/components/assistant/AssistantModel.hpp + src/components/authentication/AuthenticationNotifier.hpp + src/components/call/CallModel.hpp + src/components/calls/CallsListModel.hpp + src/components/calls/CallsListProxyModel.hpp + src/components/camera/Camera.hpp + src/components/camera/CameraPreview.hpp + src/components/camera/MSFunctions.hpp + src/components/chat/ChatModel.hpp + src/components/chat/ChatProxyModel.hpp + src/components/codecs/AbstractCodecsModel.hpp + src/components/codecs/AudioCodecsModel.hpp + src/components/codecs/VideoCodecsModel.hpp + src/components/Components.hpp + src/components/conference/ConferenceAddModel.hpp + src/components/conference/ConferenceHelperModel.hpp + src/components/conference/ConferenceModel.hpp + src/components/contact/ContactModel.hpp + src/components/contact/VcardModel.hpp + src/components/contacts/ContactsListModel.hpp + src/components/contacts/ContactsListProxyModel.hpp + src/components/core/CoreHandlers.hpp + src/components/core/CoreManager.hpp + src/components/core/event-count-notifier/AbstractEventCountNotifier.hpp + src/components/file/FileDownloader.hpp + src/components/file/FileExtractor.hpp + src/components/notifier/Notifier.hpp + src/components/other/clipboard/Clipboard.hpp + src/components/other/colors/Colors.hpp + src/components/other/desktop-tools/DesktopTools.hpp + src/components/other/text-to-speech/TextToSpeech.hpp + src/components/other/units/Units.hpp + src/components/presence/OwnPresenceModel.hpp + src/components/presence/Presence.hpp + src/components/settings/AccountSettingsModel.hpp + src/components/settings/SettingsModel.hpp + src/components/sip-addresses/SipAddressesModel.hpp + src/components/sip-addresses/SipAddressesProxyModel.hpp + src/components/sip-addresses/SipAddressObserver.hpp + src/components/sound-player/SoundPlayer.hpp + src/components/telephone-numbers/TelephoneNumbersModel.hpp + src/components/timeline/TimelineModel.hpp + src/components/url-handlers/UrlHandlers.hpp + src/utils/LinphoneUtils.hpp + src/utils/MediastreamerUtils.hpp + src/utils/QExifImageHeader.hpp + src/utils/Utils.hpp + ) - set(MAIN_FILE src/app/main.cpp) + set(MAIN_FILE src/app/main.cpp) - if (APPLE) - list(APPEND SOURCES - src/app/single-application/SingleApplication.cpp - src/components/core/event-count-notifier/EventCountNotifierMacOs.m - src/components/other/desktop-tools/DesktopToolsMacOs.cpp - src/components/other/desktop-tools/screen-saver/ScreenSaverMacOs.m - src/components/other/desktop-tools/state-process/StateProcessMacOs.mm - ) - list(APPEND HEADERS - src/app/single-application/SingleApplicationPrivate.hpp - src/components/core/event-count-notifier/EventCountNotifierMacOs.hpp - src/components/other/desktop-tools/DesktopToolsMacOs.hpp - ) - elseif (WIN32) - list(APPEND SOURCES - src/app/single-application/SingleApplication.cpp - src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.cpp - src/components/other/desktop-tools/DesktopToolsWindows.cpp - ) - list(APPEND HEADERS - src/app/single-application/SingleApplicationPrivate.hpp - src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.hpp - src/components/other/desktop-tools/DesktopToolsWindows.hpp - ) - else () - list(APPEND SOURCES - src/app/single-application/SingleApplicationDBus.cpp - src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.cpp - src/components/other/desktop-tools/DesktopToolsLinux.cpp - src/components/other/desktop-tools/screen-saver/ScreenSaverDBus.cpp - src/components/other/desktop-tools/screen-saver/ScreenSaverXdg.cpp - ) - list(APPEND HEADERS - src/app/single-application/SingleApplicationDBusPrivate.hpp - src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.hpp - src/components/other/desktop-tools/DesktopToolsLinux.hpp - src/components/other/desktop-tools/screen-saver/ScreenSaverDBus.hpp - src/components/other/desktop-tools/screen-saver/ScreenSaverXdg.hpp - ) - endif () + if (APPLE) + list(APPEND SOURCES + src/app/single-application/SingleApplication.cpp + src/components/core/event-count-notifier/EventCountNotifierMacOs.m + src/components/other/desktop-tools/DesktopToolsMacOs.cpp + src/components/other/desktop-tools/screen-saver/ScreenSaverMacOs.m + src/components/other/desktop-tools/state-process/StateProcessMacOs.mm + ) + list(APPEND HEADERS + src/app/single-application/SingleApplicationPrivate.hpp + src/components/core/event-count-notifier/EventCountNotifierMacOs.hpp + src/components/other/desktop-tools/DesktopToolsMacOs.hpp + ) + elseif (WIN32) + list(APPEND SOURCES + src/app/single-application/SingleApplication.cpp + src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.cpp + src/components/other/desktop-tools/DesktopToolsWindows.cpp + ) + list(APPEND HEADERS + src/app/single-application/SingleApplicationPrivate.hpp + src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.hpp + src/components/other/desktop-tools/DesktopToolsWindows.hpp + ) + else () + list(APPEND SOURCES + src/app/single-application/SingleApplicationDBus.cpp + src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.cpp + src/components/other/desktop-tools/DesktopToolsLinux.cpp + src/components/other/desktop-tools/screen-saver/ScreenSaverDBus.cpp + src/components/other/desktop-tools/screen-saver/ScreenSaverXdg.cpp + ) + list(APPEND HEADERS + src/app/single-application/SingleApplicationDBusPrivate.hpp + src/components/core/event-count-notifier/EventCountNotifierSystemTrayIcon.hpp + src/components/other/desktop-tools/DesktopToolsLinux.hpp + src/components/other/desktop-tools/screen-saver/ScreenSaverDBus.hpp + src/components/other/desktop-tools/screen-saver/ScreenSaverXdg.hpp + ) + endif () - set(QRC_RESOURCES resources.qrc) + set(QRC_RESOURCES resources.qrc) - set(LANGUAGES_DIRECTORY "${ASSETS_DIR}/languages") - set(I18N_FILENAME i18n.qrc) - set(LANGUAGES de en fr_FR ja lt ru sv tr pt_BR) + set(LANGUAGES_DIRECTORY "${ASSETS_DIR}/languages") + set(I18N_FILENAME i18n.qrc) + set(LANGUAGES de en fr_FR ja lt ru sv tr pt_BR) - # ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ - function (PREPEND list prefix) - set(new_list "") + function (PREPEND list prefix) + set(new_list "") - foreach (elem ${${list}}) - list(APPEND new_list "${prefix}${elem}") - endforeach () + foreach (elem ${${list}}) + list(APPEND new_list "${prefix}${elem}") + endforeach () - set(${list} ${new_list} PARENT_SCOPE) - endfunction () + set(${list} ${new_list} PARENT_SCOPE) + endfunction () - # Force absolute paths. - PREPEND(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/") - PREPEND(HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/") + # Force absolute paths. + PREPEND(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/") + PREPEND(HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/") - # ------------------------------------------------------------------------------ - # Compute QML files list. - # ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ + # Compute QML files list. + # ------------------------------------------------------------------------------ - set(QML_SOURCES) - file(STRINGS ${QRC_RESOURCES} QRC_RESOURCES_CONTENT) - foreach (line ${QRC_RESOURCES_CONTENT}) - set(result) - string(REGEX REPLACE - "^[ \t]*<[ \t]*file[ \t]*>[ \t]*(.+\\.[a-z]+)[ \t]*<[ \t]*/[ \t]*file[ \t]*>[ \t]*$" - "\\1" - result - "${line}" - ) - string(REGEX MATCH "\\.[a-z]+$" is_ui ${result}) - if (NOT ${is_ui} STREQUAL "") - list(APPEND QML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${result}") - endif () - endforeach () + set(QML_SOURCES) + file(STRINGS ${QRC_RESOURCES} QRC_RESOURCES_CONTENT) + foreach (line ${QRC_RESOURCES_CONTENT}) + set(result) + string(REGEX REPLACE + "^[ \t]*<[ \t]*file[ \t]*>[ \t]*(.+\\.[a-z]+)[ \t]*<[ \t]*/[ \t]*file[ \t]*>[ \t]*$" + "\\1" + result + "${line}" + ) + string(REGEX MATCH "\\.[a-z]+$" is_ui ${result}) + if (NOT ${is_ui} STREQUAL "") + list(APPEND QML_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${result}") + endif () + endforeach () - # ------------------------------------------------------------------------------ - # Init git hooks. - # ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ + # Init git hooks. + # ------------------------------------------------------------------------------ - if (NOT WIN32) - add_custom_target( - check_qml DEPENDS ${QML_SOURCES} - COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/check_qml_syntax" - ) - endif() + if (NOT WIN32) + add_custom_target( + check_qml DEPENDS ${QML_SOURCES} + COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/check_qml_syntax" + ) + endif() - execute_process(COMMAND ${CMAKE_COMMAND} -E copy - "${CMAKE_CURRENT_SOURCE_DIR}/tools/private/pre-commit" - "${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit" - ) - set(_QML_IMPORT_PATHS "") - list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/modules") - list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/dev-modules") - list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/scripts") - list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/views") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/tools/private/pre-commit" + "${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit" + ) + set(_QML_IMPORT_PATHS "") + list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/modules") + list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/dev-modules") + list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/scripts") + list(APPEND _QML_IMPORT_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui/views") - set(QML_IMPORT_PATH ${_QML_IMPORT_PATHS} CACHE STRING "Path used to locate CMake modules by Qt Creator" FORCE) + set(QML_IMPORT_PATH ${_QML_IMPORT_PATHS} CACHE STRING "Path used to locate CMake modules by Qt Creator" FORCE) - if(APPLE) - if(MS2_PLUGINS_LOCATION) - set(MSPLUGINS_DIR ${MS2_PLUGINS_LOCATION}) - else() - set(MSPLUGINS_DIR "Frameworks/mediastreamer2.framework/Versions/A/Libraries") - endif() - else() - set(MSPLUGINS_DIR "${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins") - endif() - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h") - # ------------------------------------------------------------------------------ - # Build. - # ------------------------------------------------------------------------------ + if(APPLE) + if(MS2_PLUGINS_LOCATION) + set(MSPLUGINS_DIR ${MS2_PLUGINS_LOCATION}) + else() + set(MSPLUGINS_DIR "Frameworks/mediastreamer2.framework/Versions/A/Libraries") + endif() + else() + set(MSPLUGINS_DIR "${CMAKE_INSTALL_LIBDIR}/mediastreamer/plugins") + endif() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config.h") + # ------------------------------------------------------------------------------ + # Build. + # ------------------------------------------------------------------------------ - include_directories(src/) + include_directories(src/) - find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED) - find_package(Qt5 COMPONENTS ${QT5_PACKAGES_OPTIONAL} QUIET) + find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED) + find_package(Qt5 COMPONENTS ${QT5_PACKAGES_OPTIONAL} QUIET) - if (CMAKE_INSTALL_RPATH) - #Retrieve lib path from a know QT executable - get_target_property(LUPDATE_PATH Qt5::lupdate LOCATION) - get_filename_component(LUPDATE_PATH "${LUPDATE_PATH}" DIRECTORY) - get_filename_component(QT_PATH "${LUPDATE_PATH}/../lib" ABSOLUTE) - list(APPEND CMAKE_INSTALL_RPATH "${QT_PATH}") - endif () - # Add languages support. - add_subdirectory(${LANGUAGES_DIRECTORY}) + if (CMAKE_INSTALL_RPATH) + #Retrieve lib path from a know QT executable + get_target_property(LUPDATE_PATH Qt5::lupdate LOCATION) + get_filename_component(LUPDATE_PATH "${LUPDATE_PATH}" DIRECTORY) + get_filename_component(QT_PATH "${LUPDATE_PATH}/../lib" ABSOLUTE) + list(APPEND CMAKE_INSTALL_RPATH "${QT_PATH}") + endif () + # Add languages support. + add_subdirectory(${LANGUAGES_DIRECTORY}) - list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_FILENAME}") + list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGES_DIRECTORY}/${I18N_FILENAME}") - # Build. - #add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${RESOURCES} ${QML_SOURCES}) - add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${QML_SOURCES} ${QRC_RESOURCES}) - set_property(TARGET ${APP_LIBRARY} PROPERTY POSITION_INDEPENDENT_CODE ON) + # Build. + #add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${RESOURCES} ${QML_SOURCES}) + add_library(${APP_LIBRARY} OBJECT ${SOURCES} ${HEADERS} ${QML_SOURCES} ${QRC_RESOURCES}) + set_property(TARGET ${APP_LIBRARY} PROPERTY POSITION_INDEPENDENT_CODE ON) - #Turn on automatic resources compilation by cmake - #Instead of excplicitely calling qt5_add_resources - set_property(TARGET ${APP_LIBRARY} PROPERTY AUTORCC ON) + #Turn on automatic resources compilation by cmake + #Instead of excplicitely calling qt5_add_resources + set_property(TARGET ${APP_LIBRARY} PROPERTY AUTORCC ON) - bc_git_version(${TARGET_NAME} ${PROJECT_VERSION}) - add_dependencies(${APP_LIBRARY} ${TARGET_NAME}-git-version) - add_dependencies(${APP_LIBRARY} update_translations) - if (WIN32) - add_executable(${TARGET_NAME} WIN32 $ ${ASSETS_DIR}/app-icon.rc ${MAIN_FILE}) - else () - add_executable(${TARGET_NAME} $ ${MAIN_FILE}) - endif () + bc_git_version(${TARGET_NAME} ${PROJECT_VERSION}) + add_dependencies(${APP_LIBRARY} ${TARGET_NAME}-git-version) + add_dependencies(${APP_LIBRARY} update_translations) + if (WIN32) + add_executable(${TARGET_NAME} WIN32 $ ${ASSETS_DIR}/app-icon.rc ${MAIN_FILE}) + else () + add_executable(${TARGET_NAME} $ ${MAIN_FILE}) + endif () - set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}") - set(INCLUDED_DIRECTORIES "${LINPHONECXX_INCLUDE_DIRS}" "${LINPHONE_INCLUDE_DIRS}" "${BELCARD_INCLUDE_DIRS}" "${BCTOOLBOX_INCLUDE_DIRS}" "${MEDIASTREAMER2_INCLUDE_DIRS}" "${MINIZIP_INCLUDE_DIRS}") - set(LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BELCARD_LIBRARIES} ${LINPHONE_LIBRARIES} ${LINPHONECXX_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES} ${OPUS_LIBRARIES}) - if(WIN32) - list(APPEND LIBRARIES ${MINIZIP_LIBRARIES}) - endif() - foreach (package ${QT5_PACKAGES}) - list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}") - # `qt5_create_translation` is provided from `LinguistTools` package. - # But the `Qt5::LinguistTools` lib does not exist. Remove it. - if (NOT (${package} STREQUAL LinguistTools)) - list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES}) - endif () - endforeach () + set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}") + set(INCLUDED_DIRECTORIES "${LINPHONECXX_INCLUDE_DIRS}" "${LINPHONE_INCLUDE_DIRS}" "${BELCARD_INCLUDE_DIRS}" "${BCTOOLBOX_INCLUDE_DIRS}" "${MEDIASTREAMER2_INCLUDE_DIRS}" "${MINIZIP_INCLUDE_DIRS}") + set(LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BELCARD_LIBRARIES} ${LINPHONE_LIBRARIES} ${LINPHONECXX_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${ORTP_LIBRARIES} ${OPUS_LIBRARIES}) + if(WIN32) + list(APPEND LIBRARIES ${MINIZIP_LIBRARIES}) + endif() + foreach (package ${QT5_PACKAGES}) + list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}") + # `qt5_create_translation` is provided from `LinguistTools` package. + # But the `Qt5::LinguistTools` lib does not exist. Remove it. + if (NOT (${package} STREQUAL LinguistTools)) + list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES}) + endif () + endforeach () - foreach (package ${QT5_PACKAGES_OPTIONAL}) - if ("${Qt5${package}_FOUND}") - message("Optional package ${package} found.") - list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}") - list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES}) + foreach (package ${QT5_PACKAGES_OPTIONAL}) + if ("${Qt5${package}_FOUND}") + message("Optional package ${package} found.") + list(APPEND INCLUDED_DIRECTORIES "${Qt5${package}_INCLUDE_DIRS}") + list(APPEND LIBRARIES ${Qt5${package}_LIBRARIES}) - string(TOUPPER "${package}" INCLUDE_NAME) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${INCLUDE_NAME}_ENABLED") - else () - message("Optional package ${package} not found.") - endif () - endforeach () + string(TOUPPER "${package}" INCLUDE_NAME) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${INCLUDE_NAME}_ENABLED") + else () + message("Optional package ${package} not found.") + endif () + endforeach () - if (APPLE) - list(APPEND LIBRARIES "-framework Cocoa -framework IOKit") - # -framework linphone") #This doesn't work yet - endif () - target_include_directories(${APP_LIBRARY} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES}) - target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES}) + if (APPLE) + list(APPEND LIBRARIES "-framework Cocoa -framework IOKit") + # -framework linphone") #This doesn't work yet + endif () + target_include_directories(${APP_LIBRARY} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES}) + target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${INCLUDED_DIRECTORIES}) - target_link_libraries(${TARGET_NAME} ${LIBRARIES}) - if(WIN32) - target_link_libraries(${TARGET_NAME} wsock32 ws2_32) - endif() + target_link_libraries(${TARGET_NAME} ${LIBRARIES}) + if(WIN32) + target_link_libraries(${TARGET_NAME} wsock32 ws2_32) + endif() - foreach (target ${TARGET_NAME}) - install(TARGETS ${target} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - ) - endforeach () + foreach (target ${TARGET_NAME}) + message("Available target : ${target}") + # install(TARGETS ${target} + # RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + # LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + # ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + # PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + # ) + endforeach () - if (UNIX AND NOT APPLE) - # Install desktop/icon files. - configure_file("${ASSETS_DIR}/linphone.desktop.cmake" "${EXECUTABLE_NAME}.desktop" @ONLY) + if (UNIX AND NOT APPLE) + # Install desktop/icon files. + configure_file("${ASSETS_DIR}/linphone.desktop.cmake" "${EXECUTABLE_NAME}.desktop" @ONLY) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}.desktop" - DESTINATION "${CMAKE_INSTALL_DATADIR}/applications" - ) - install(FILES "${ASSETS_DIR}/images/linphone_logo.svg" - DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps/" - RENAME "${EXECUTABLE_NAME}.svg" - ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}.desktop" + DESTINATION "${CMAKE_INSTALL_DATADIR}/applications" + ) + install(FILES "${ASSETS_DIR}/images/linphone_logo.svg" + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps/" + RENAME "${EXECUTABLE_NAME}.svg" + ) - set(ICON_DIRS 16x16 22x22 24x24 32x32 64x64 128x128 256x256) - foreach (DIR ${ICON_DIRS}) - install(FILES "${ASSETS_DIR}/icons/hicolor/${DIR}/apps/icon.png" - DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${DIR}/apps/" - RENAME "${EXECUTABLE_NAME}.png" - ) - endforeach () - endif () + set(ICON_DIRS 16x16 22x22 24x24 32x32 64x64 128x128 256x256) + foreach (DIR ${ICON_DIRS}) + install(FILES "${ASSETS_DIR}/icons/hicolor/${DIR}/apps/icon.png" + DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/${DIR}/apps/" + RENAME "${EXECUTABLE_NAME}.png" + ) + endforeach () + endif () - # ------------------------------------------------------------------------------ - # Install rc files. - # ------------------------------------------------------------------------------ + # ------------------------------------------------------------------------------ + # Install rc files. + # ------------------------------------------------------------------------------ + if(APPLE) + set(PACKAGING_DIR "${APPLICATION_NAME}.app/Contents/Resources") + else() + set(PACKAGING_DIR "") + endif() + install(FILES "${ASSETS_DIR}/linphonerc-factory" + DESTINATION "${PACKAGING_DIR}/${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}" + ) - install(FILES "${ASSETS_DIR}/linphonerc-factory" - DESTINATION "${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}" - ) + set(ASSETS_ASSISTANT_DIR "${ASSETS_DIR}/assistant") + set(ASSISTANT_INSTALL_DATADIR "${PACKAGING_DIR}/${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}/assistant") - set(ASSETS_ASSISTANT_DIR "${ASSETS_DIR}/assistant") - set(ASSISTANT_INSTALL_DATADIR "${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}/assistant") + install(FILES "${ASSETS_ASSISTANT_DIR}/use-other-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}" + ) + install(FILES "${ASSETS_ASSISTANT_DIR}/create-app-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}" + ) + install(FILES "${ASSETS_ASSISTANT_DIR}/use-app-sip-account.rc" + DESTINATION "${ASSISTANT_INSTALL_DATADIR}" + ) - install(FILES "${ASSETS_ASSISTANT_DIR}/use-other-sip-account.rc" - DESTINATION "${ASSISTANT_INSTALL_DATADIR}" - ) - install(FILES "${ASSETS_ASSISTANT_DIR}/create-app-sip-account.rc" - DESTINATION "${ASSISTANT_INSTALL_DATADIR}" - ) - install(FILES "${ASSETS_ASSISTANT_DIR}/use-app-sip-account.rc" - DESTINATION "${ASSISTANT_INSTALL_DATADIR}" - ) + # ------------------------------------------------------------------------------ + # CPack settings & RPM. + # ------------------------------------------------------------------------------ + set(LINPHONE_DESKTOP_DIR "${CMAKE_SOURCE_DIR}") + set(LINPHONE_SDK_DIR "${CMAKE_BINARY_DIR}/linphone-sdk") + set(TOOLS_DIR "${CMAKE_BINARY_DIR}/programs") + set(LINPHONE_SOURCE_DIR ${EP_linphone_SOURCE_DIR}) + set(LINPHONE_BUILDER_SIGNING_IDENTITY ${LINPHONE_BUILDER_SIGNING_IDENTITY}) + set(LINPHONE_SDK_TMP "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-tmp") - # ------------------------------------------------------------------------------ - # CPack settings & RPM. - # ------------------------------------------------------------------------------ - set(LINPHONE_DESKTOP_DIR "${CMAKE_SOURCE_DIR}") - set(LINPHONE_OUTPUT_DIR "${CMAKE_INSTALL_PREFIX}") - set(LINPHONE_SDK_DIR "${CMAKE_BINARY_DIR}/linphone-sdk") - set(TOOLS_DIR "${CMAKE_BINARY_DIR}/programs") - set(LINPHONE_SOURCE_DIR ${EP_linphone_SOURCE_DIR}) - set(LINPHONE_BUILDER_SIGNING_IDENTITY ${LINPHONE_BUILDER_SIGNING_IDENTITY}) - set(LINPHONE_SDK_TMP "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-tmp") + add_subdirectory(build) + add_subdirectory(cmake_builder/linphone_package) - add_subdirectory(build) - add_subdirectory(cmake_builder/linphone_package) + # ------------------------------------------------------------------------------ + # To start better integration into IDE. + # ------------------------------------------------------------------------------ - # ------------------------------------------------------------------------------ - # To start better integration into IDE. - # ------------------------------------------------------------------------------ + source_group( + "Qml" REGULAR_EXPRESSION ".+\.qml$" + ) + source_group( + "Js" REGULAR_EXPRESSION ".+\.js$" + ) + source_group( + "Svg" REGULAR_EXPRESSION ".+\.svg$" + ) - source_group( - "Qml" REGULAR_EXPRESSION ".+\.qml$" - ) - source_group( - "Js" REGULAR_EXPRESSION ".+\.js$" - ) - source_group( - "Svg" REGULAR_EXPRESSION ".+\.svg$" - ) - - # ------------------------------ - # Installation - # ------------------------------ - install(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake_builder/install.cmake") - #endif () - - if(APPLE) - target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib/libminizip.dylib") - elseif(NOT WIN32) - if( EXISTS "${CMAKE_INSTALL_PREFIX}/lib64/libminizip.so") - target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib64/libminizip.so") - elseif(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/libminizip.so") - target_link_libraries(${TARGET_NAME} "${CMAKE_INSTALL_PREFIX}/lib/libminizip.so") - else() - message("Error cannot find ${CMAKE_INSTALL_PREFIX}/lib*/libminizip.so while linking") - endif() - endif() + # ------------------------------ + # Installation + # ------------------------------ + install(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake_builder/install.cmake") + if(APPLE) + target_link_libraries(${TARGET_NAME} "${MINIZIP_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/libminizip.dylib") + execute_process(COMMAND install_name_tool -id "@executable_path/../Frameworks/libminizip.dylib" "${MINIZIP_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/libminizip.dylib") + elseif(NOT WIN32) + target_link_libraries(${TARGET_NAME} "${MINIZIP_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/libminizip.so") + endif() endif()#If (LinphoneCxx_FOUND AND Minizip_FOUND) endif()#If (LinphoneCxx_FOUND) diff --git a/cmake_builder/install.cmake b/cmake_builder/install.cmake index b327360e8..1764be3d6 100644 --- a/cmake_builder/install.cmake +++ b/cmake_builder/install.cmake @@ -22,7 +22,7 @@ include(../application_info.cmake) if (APPLE) #execute_process(COMMAND install_name_tool -id "@executable_path/../lib/libminizip.dylib" "${CMAKE_INSTALL_PREFIX}/lib/libminizip.dylib") - execute_process(COMMAND install_name_tool -add_rpath "@executable_path/../Frameworks/" "${CMAKE_INSTALL_PREFIX}/bin/${EXECUTABLE_NAME}") - execute_process(COMMAND install_name_tool -add_rpath "@executable_path/../lib/" "${CMAKE_INSTALL_PREFIX}/bin/${EXECUTABLE_NAME}") + execute_process(COMMAND install_name_tool -add_rpath "@executable_path/../Frameworks/" "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}") + execute_process(COMMAND install_name_tool -add_rpath "@executable_path/../lib/" "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}") else () endif () diff --git a/cmake_builder/linphone_package/CMakeLists.txt b/cmake_builder/linphone_package/CMakeLists.txt index 67fc91ff0..507cacf2e 100644 --- a/cmake_builder/linphone_package/CMakeLists.txt +++ b/cmake_builder/linphone_package/CMakeLists.txt @@ -62,95 +62,27 @@ set(PACKAGE_VERSION "${LINPHONE_VERSION}") # Preparing the Linphone SDK bundle. # ============================================================================== -# Create sdk-temp folder where we can find all needed files (libs, includes etc.) - -file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}") message(" Linphone_SDK_DIR : ${LINPHONE_SDK_DIR}") -file(COPY "${LINPHONE_SDK_DIR}/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") -if(APPLE) - execute_process(COMMAND install_name_tool -id "@executable_path/../Frameworks/libminizip.dylib" "${CMAKE_INSTALL_PREFIX}/lib/libminizip.dylib") -elseif(WIN32) - -endif() -file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/desktop" "${LINPHONE_SDK_TMP}") - -# Generates a zip archive containing the development files. -macro (add_sdk_list_file NAME) - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/sdk_content/${NAME}.list.in" "${LINPHONE_SDK_TMP}/${NAME}.list" @ONLY) - list(APPEND LIST_FILES "${LINPHONE_SDK_TMP}/${NAME}.list") -endmacro () if (WIN32) - set(LIBDIR "bin") + set(LIBDIR ${CMAKE_INSTALL_BINDIR}) set(LIBPREFIX "") set(LIBEXT "dll") set(PLUGINEXT "dll") elseif (APPLE) - set(LIBDIR "lib") + set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) set(LIBPREFIX "lib") set(LIBEXT "dylib") set(PLUGINEXT "so") endif () -set(LIST_FILES ) -add_sdk_list_file(bctoolbox) -add_sdk_list_file(bellesip) -add_sdk_list_file(ortp) -add_sdk_list_file(ms2) -add_sdk_list_file(ms2plugins) -add_sdk_list_file(linphone) -add_sdk_list_file(linphonecxx) -if (WIN32) - add_sdk_list_file(sqlite3) - add_sdk_list_file(xml2) - add_sdk_list_file(zlib) -endif () -if (ENABLE_UNIT_TESTS) - add_sdk_list_file(bcunit) -endif () -if (ENABLE_VCARD) - add_sdk_list_file(vcard) -endif () -if (ENABLE_BV16) - add_sdk_list_file(bv16) -endif () -if (ENABLE_GSM) - add_sdk_list_file(gsm) -endif () -if (ENABLE_OPUS) - add_sdk_list_file(opus) -endif () -if (ENABLE_SPEEX) - add_sdk_list_file(speex) -endif () -if (ENABLE_MBEDTLS) - add_sdk_list_file(mbedtls) -endif () -if (ENABLE_POLARSSL) - add_sdk_list_file(polarssl) -endif () -if (ENABLE_SRTP) - add_sdk_list_file(srtp) -endif () -if (ENABLE_ZRTP) - add_sdk_list_file(bzrtp) -endif () -if (ENABLE_FFMPEG) - add_sdk_list_file(ffmpeg) -endif () -file(WRITE "${LINPHONE_SDK_TMP}/${EXECUTABLE_NAME}-sdk.list" "") -foreach (FILE ${LIST_FILES}) - file(READ "${FILE}" CONTENT) - file(APPEND "${LINPHONE_SDK_TMP}/${EXECUTABLE_NAME}-sdk.list" "${CONTENT}\n") -endforeach () - # Removed unless it is usefull to get a zip from SDK : The SDK is packaged with binaries. #if (WIN32) # find_program(7Z_PROGRAM 7z PATHS "$ENV{ProgramFiles}/7-Zip") # if (7Z_PROGRAM) # execute_process( # COMMAND ${7Z_PROGRAM} a -tzip ${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-win32.zip "@${EXECUTABLE_NAME}-sdk.list" -# WORKING_DIRECTORY ${LINPHONE_SDK_TMP} +# WORKING_DIRECTORY ${LINPHONE_OUTPUT_DIR} # ) # else () # message(WARNING "7z has not been found, cannot generate the SDK!") @@ -159,7 +91,7 @@ endforeach () # execute_process( # COMMAND rm -rf "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-mac.zip" # COMMAND zip -ry "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}-sdk-${LINPHONE_GIT_REVISION}-mac.zip" . -i "@${EXECUTABLE_NAME}-sdk.list" -# WORKING_DIRECTORY ${LINPHONE_SDK_TMP} +# WORKING_DIRECTORY ${LINPHONE_OUTPUT_DIR} # ) #endif () @@ -171,33 +103,33 @@ if (WIN32) #execute_process( # COMMAND windeployqt "${LINPHONE_OUTPUT_DIR}/bin/${EXECUTABLE_NAME}.exe" "--qmldir" "${LINPHONE_QML_DIR}" #) - install( CODE "execute_process(COMMAND windeployqt ${LINPHONE_OUTPUT_DIR}/bin/${EXECUTABLE_NAME}.exe --qmldir=${LINPHONE_QML_DIR})")# -verbose=2)" ) + install( CODE "execute_process(COMMAND windeployqt ${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}/${EXECUTABLE_NAME}.exe --qmldir=${LINPHONE_QML_DIR})")# -verbose=2)" COMPONENT application) - file(GLOB LIB_FILES "${LINPHONE_SDK_TMP}/lib/*.dll") - install(FILES ${LIB_FILES} DESTINATION "bin/") - file(GLOB LIB_FILES "${LINPHONE_SDK_TMP}/bin/*.dll") - install(FILES ${LIB_FILES} DESTINATION "bin/") - file(GLOB EXE_FILES "${LINPHONE_SDK_TMP}/bin/*.exe") - install(FILES ${EXE_FILES} DESTINATION "bin/") - if (EXISTS "${LINPHONE_SDK_TMP}/lib/mediastreamer") - install(DIRECTORY "${LINPHONE_SDK_TMP}/lib/mediastreamer" DESTINATION "lib" USE_SOURCE_PERMISSIONS) + file(GLOB LIB_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/*.dll") + install(FILES ${LIB_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}/") + file(GLOB LIB_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}/*.dll") + install(FILES ${LIB_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}/") + file(GLOB EXE_FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}/*.exe") + install(FILES ${EXE_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}/") + if (EXISTS "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer") + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer" DESTINATION "${CMAKE_INSTALL_LIBDIR}" USE_SOURCE_PERMISSIONS) endif () - install(DIRECTORY "${LINPHONE_SDK_TMP}/share/images" DESTINATION "share" USE_SOURCE_PERMISSIONS) - install(DIRECTORY "${LINPHONE_SDK_TMP}/share/sounds" DESTINATION "share" USE_SOURCE_PERMISSIONS) - install(FILES "${LINPHONE_SDK_TMP}/share/Linphone/rootca.pem" DESTINATION "share/Linphone/") + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/images" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS) + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/sounds" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS) + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/Linphone/rootca.pem" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${EXECUTABLE_NAME}/") -# list(REMOVE_ITEM SHARE_CONTENT "share/belr" "share/Belr" "share/images" "share/${APPLICATION_NAME}" "share/${APPLICATION_NAME}" "share/sounds") +# list(REMOVE_ITEM SHARE_CONTENT "${CMAKE_INSTALL_DATAROOTDIR}/belr" "${CMAKE_INSTALL_DATAROOTDIR}/Belr" "${CMAKE_INSTALL_DATAROOTDIR}/images" "${CMAKE_INSTALL_DATAROOTDIR}/${APPLICATION_NAME}" "${CMAKE_INSTALL_DATAROOTDIR}/${APPLICATION_NAME}" "${CMAKE_INSTALL_DATAROOTDIR}/sounds") # foreach (ITEM IN LISTS SHARE_CONTENT) # list(APPEND SHARE_CONTENT_EXCLUDE PATTERN "${ITEM}" EXCLUDE) # endforeach () elseif (APPLE) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist.in" "${CMAKE_INSTALL_PREFIX}/${APPLICATION_NAME}.app/Contents/Info.plist" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/macos/linphone.icns" "${CMAKE_INSTALL_PREFIX}/${APPLICATION_NAME}.app/Contents/Resources/${EXECUTABLE_NAME}.icns" COPYONLY) - install(DIRECTORY "${LINPHONE_SDK_TMP}/Frameworks/" DESTINATION "${APPLICATION_NAME}.app/Contents/Frameworks" USE_SOURCE_PERMISSIONS) - install(PROGRAMS "${CMAKE_INSTALL_PREFIX}/bin/${EXECUTABLE_NAME}" DESTINATION "${APPLICATION_NAME}.app/Contents/MacOS") - file(GLOB SHARED_LIBRARIES "${LINPHONE_SDK_TMP}/lib/lib*.dylib") + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/Frameworks/" DESTINATION "${APPLICATION_NAME}.app/Contents/Frameworks" USE_SOURCE_PERMISSIONS COMPONENT application) + install(PROGRAMS "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}" DESTINATION "${APPLICATION_NAME}.app/Contents/MacOS" COMPONENT application) + file(GLOB SHARED_LIBRARIES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/lib*.dylib") foreach (LIBRARY ${SHARED_LIBRARIES}) - install(FILES "${LIBRARY}" DESTINATION "${APPLICATION_NAME}.app/Contents/Frameworks") + install(FILES "${LIBRARY}" DESTINATION "${APPLICATION_NAME}.app/Contents/Frameworks" COMPONENT application) endforeach () find_program(DEPLOYQT_PROGRAM macdeployqt) @@ -206,32 +138,27 @@ elseif (APPLE) endif () - if (EXISTS "${LINPHONE_OUTPUT_DIR}/lib/mediastreamer") - file(COPY "${LINPHONE_OUTPUT_DIR}/lib/mediastreamer" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/lib" USE_SOURCE_PERMISSIONS) + if (EXISTS "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer") + file(COPY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_LIBDIR}" USE_SOURCE_PERMISSIONS) endif () - install(FILES "${LINPHONE_OUTPUT_DIR}/lib/libminizip.dylib" DESTINATION "${APPLICATION_NAME}.app/Contents/Frameworks/") - install(FILES "${LINPHONE_SDK_TMP}/share/Belr/grammars/cpim_grammar" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/belr/grammars/") - install(FILES "${LINPHONE_SDK_TMP}/share/Belr/grammars/vcard_grammar" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/belr/grammars/") - install(DIRECTORY "${LINPHONE_SDK_TMP}/share/images" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share" USE_SOURCE_PERMISSIONS) - install(DIRECTORY "${LINPHONE_SDK_TMP}/share/sounds" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share" USE_SOURCE_PERMISSIONS) - install(FILES "${LINPHONE_SDK_TMP}/share/Linphone/rootca.pem" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}") - install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/linphonerc-factory" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}") - - install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/assistant/use-other-sip-account.rc" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}/assistant") - install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/assistant/create-app-sip-account.rc" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}/assistant") - install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/assistant/use-app-sip-account.rc" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/share/${APPLICATION_NAME}/assistant") + install(FILES "${MINIZIP_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/libminizip.dylib" DESTINATION "${APPLICATION_NAME}.app/Contents/Frameworks/" COMPONENT application) + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/Belr/grammars/cpim_grammar" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/" COMPONENT application) + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/Belr/grammars/vcard_grammar" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/" COMPONENT application) + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/images" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS COMPONENT application) + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/sounds" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS COMPONENT application) + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/Linphone/rootca.pem" DESTINATION "${APPLICATION_NAME}.app/Contents/Resources/${CMAKE_INSTALL_DATAROOTDIR}/${APPLICATION_NAME}" COMPONENT application) file(GLOB SHARED_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_NAME}.app/Contents/Frameworks/lib*.dylib") foreach (LIBRARY ${SHARED_LIBRARIES}) get_filename_component(LIBRARY_FILENAME ${LIBRARY} NAME) if(NOT ("${LIBRARY_FILENAME}" STREQUAL "libminizip.dylib")) - message("Changing RPATH of ${LIBRARY_FILENAME} from '${LINPHONE_OUTPUT_DIR}/lib' to '@executable_path/../Frameworks'") - execute_process(COMMAND install_name_tool -rpath "${LINPHONE_OUTPUT_DIR}/lib" "@executable_path/../Frameworks" "${LIBRARY}") + message("Changing RPATH of ${LIBRARY_FILENAME} from '${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}' to '@executable_path/../Frameworks'") + execute_process(COMMAND install_name_tool -rpath "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}" "@executable_path/../Frameworks" "${LIBRARY}") endif() endforeach () - install( CODE "execute_process(COMMAND ${DEPLOYQT_PROGRAM} ${CMAKE_INSTALL_PREFIX}/${APPLICATION_NAME}.app -qmldir=${LINPHONE_QML_DIR})")# -verbose=2)" ) + install( CODE "execute_process(COMMAND ${DEPLOYQT_PROGRAM} ${CMAKE_INSTALL_PREFIX}/${APPLICATION_NAME}.app -qmldir=${LINPHONE_QML_DIR})")# -verbose=2)" COMPONENT application) if (LINPHONE_BUILDER_SIGNING_IDENTITY) file(GLOB FRAMEWORKS_NAMES "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_NAME}.app/Contents/Frameworks/*") @@ -247,45 +174,32 @@ elseif (APPLE) endforeach () execute_process(COMMAND "codesign" "--verbose" "-s" "${LINPHONE_BUILDER_SIGNING_IDENTITY}" "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_NAME}.app") endif () -# install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_NAME}.app" DESTINATION "." USE_SOURCE_PERMISSIONS) +# install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${APPLICATION_NAME}.app" DESTINATION "." USE_SOURCE_PERMISSIONS COMPONENT application) -# configure_file("${CMAKE_CURRENT_SOURCE_DIR}/macos/packaging.cmake.in" "packaging.cmake" @ONLY) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/macos/packaging.cmake.in" "packaging.cmake" @ONLY) # install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/packaging.cmake") else()# Not Windows and Apple foreach (LIBRARY ${SHARED_LIBRARIES}) get_filename_component(LIBRARY_FILENAME ${LIBRARY} NAME) - #if(NOT ("${LIBRARY_FILENAME}" STREQUAL "libminizip.dylib")) - message("Changing RPATH of ${LIBRARY_FILENAME} from '${LINPHONE_OUTPUT_DIR}/lib' to '$ORIGIN/../lib'") - execute_process(COMMAND install_name_tool -rpath "${LINPHONE_OUTPUT_DIR}/lib" "$ORIGIN/../lib" "${LIBRARY}") - execute_process(COMMAND install_name_tool -add_rpath "$ORIGIN/../lib64" "${LIBRARY}") - #endif() - endforeach () - install(DIRECTORY "${LINPHONE_SDK_TMP}/bin/" DESTINATION "bin" USE_SOURCE_PERMISSIONS) + message("Changing RPATH of ${LIBRARY_FILENAME} from '${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}' to '$ORIGIN/../${CMAKE_INSTALL_LIBDIR}'") + execute_process(COMMAND install_name_tool -rpath "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}" "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}" "${LIBRARY}") + endforeach () + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}/" DESTINATION "${CMAKE_INSTALL_BINDIR}" USE_SOURCE_PERMISSIONS) #Just in case. This is useless because we have to use CMAKE_INSTALL_LIBDIR - if( EXISTS "${LINPHONE_SDK_TMP}/lib/") - install(DIRECTORY "${LINPHONE_SDK_TMP}/lib/" DESTINATION "lib" USE_SOURCE_PERMISSIONS) + if( EXISTS "${LINPHONE_OUTPUT_DIR}/lib/") + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/" DESTINATION "lib" USE_SOURCE_PERMISSIONS) endif() - if( EXISTS "${LINPHONE_SDK_TMP}/lib64/") - install(DIRECTORY "${LINPHONE_SDK_TMP}/lib64/" DESTINATION "lib64" USE_SOURCE_PERMISSIONS) + if( EXISTS "${LINPHONE_OUTPUT_DIR}/lib64/") + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib64/" DESTINATION "lib64" USE_SOURCE_PERMISSIONS) endif() - install(DIRECTORY "${LINPHONE_SDK_TMP}/share/" DESTINATION "share" USE_SOURCE_PERMISSIONS) - #install(PROGRAMS "${CMAKE_INSTALL_PREFIX}/bin/${EXECUTABLE_NAME}" DESTINATION "/bin") + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS) - - if (EXISTS "${LINPHONE_SDK_TMP}/lib/mediastreamer") - file(COPY "${LINPHONE_SDK_TMP}/lib/mediastreamer" DESTINATION "lib" USE_SOURCE_PERMISSIONS) + if (EXISTS "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer") + file(COPY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer" DESTINATION "${CMAKE_INSTALL_LIBDIR}" USE_SOURCE_PERMISSIONS) endif () - install(FILES "${LINPHONE_SDK_TMP}/share/belr/grammars/cpim_grammar" DESTINATION "share/belr/grammars/") - install(FILES "${LINPHONE_SDK_TMP}/share/belr/grammars/vcard_grammar" DESTINATION "share/belr/grammars/") -# install(DIRECTORY "${LINPHONE_SDK_TMP}/share/images" DESTINATION "share" USE_SOURCE_PERMISSIONS) -# install(DIRECTORY "${LINPHONE_SDK_TMP}/share/sounds" DESTINATION "share" USE_SOURCE_PERMISSIONS) - #install(FILES "${LINPHONE_SDK_TMP}/share/${APPLICATION_NAME}/rootca.pem" DESTINATION "share/${APPLICATION_NAME}") - install(FILES "${LINPHONE_SDK_TMP}/share/linphone/rootca.pem" DESTINATION "share/${APPLICATION_NAME}") #We use executable_name because of name folder that is not harmonized from the SDK -# install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/linphonerc-factory" DESTINATION "share/${APPLICATION_NAME}") - -# install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/assistant/use-other-sip-account.rc" DESTINATION "share/${APPLICATION_NAME}/assistant") -# install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/assistant/create-app-sip-account.rc" DESTINATION "share/${APPLICATION_NAME}/assistant") -# install(FILES "${LINPHONE_OUTPUT_DIR}/share/${APPLICATION_NAME}/assistant/use-app-sip-account.rc" DESTINATION "share/${APPLICATION_NAME}/assistant") + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/cpim_grammar" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/") + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/vcard_grammar" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/") + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/linphone/rootca.pem" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${APPLICATION_NAME}") #We use executable_name because of name folder that is not harmonized from the SDK endif () # Temporary deactivate @@ -298,7 +212,7 @@ endif () # if (NOT VCRUNTIME_LIB) # find_file(VCRUNTIME_LIB "msvcr${MSVC_VERSION}0.dll" PATHS "C:/Windows/System32") # endif () -# install(FILES ${MSVCP_LIB} ${UCRTBASE_LIB} ${VCRUNTIME_LIB} DESTINATION "bin") +# install(FILES ${MSVCP_LIB} ${UCRTBASE_LIB} ${VCRUNTIME_LIB} DESTINATION "${CMAKE_INSTALL_BINDIR}") # if (CMAKE_BUILD_TYPE STREQUAL "Debug") # find_file(MSVCPD_LIB "msvcp${MSVC_VERSION}0d.dll" PATHS "C:/Windows/System32") # find_file(UCRTBASED_LIB "ucrtbased.dll" PATHS "C:/Windows/System32") @@ -306,7 +220,7 @@ endif () # if (NOT VCRUNTIMED_LIB) # find_file(VCRUNTIMED_LIB "msvcr${MSVC_VERSION}0d.dll" PATHS "C:/Windows/System32") # endif () -# install(FILES ${MSVCPD_LIB} ${UCRTBASED_LIB} ${VCRUNTIMED_LIB} DESTINATION "bin") +# install(FILES ${MSVCPD_LIB} ${UCRTBASED_LIB} ${VCRUNTIMED_LIB} DESTINATION "${CMAKE_INSTALL_BINDIR}") # endif () #endif () @@ -322,7 +236,6 @@ if (LINPHONE_MICRO_VERSION) set(CPACK_PACKAGE_VERSION_PATCH ${LINPHONE_MICRO_VERSION}) endif () set(CPACK_PACKAGE_EXECUTABLES "${EXECUTABLE_NAME};${APPLICATION_NAME}") -set(CPACK_PACKAGE_INSTALL_DIRECTORY "${APPLICATION_NAME}") set(CPACK_RESOURCE_FILE_LICENSE "${LINPHONE_DESKTOP_DIR}/LICENSE.txt") if (APPLE) @@ -331,6 +244,9 @@ if (APPLE) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/macos/linphone_dmg.scpt.in" "${CMAKE_CURRENT_BINARY_DIR}/linphone_dmg.scpt" @ONLY) set(CPACK_DMG_DS_STORE_SETUP_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/linphone_dmg.scpt") + set(CPACK_BINARY_DRAGNDROP ON) +else() + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${APPLICATION_NAME}") endif () if (WIN32) @@ -378,7 +294,7 @@ if (WIN32) set(PASSPHRASE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/sign/passphrase.txt") get_filename_component(WINSDK_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" REALPATH CACHE) find_package(PythonInterp) - find_program(SIGNTOOL signtool PATHS ${WINSDK_DIR}/bin) + find_program(SIGNTOOL signtool PATHS ${WINSDK_DIR}/${CMAKE_INSTALL_BINDIR}) set(SIGNTOOL_COMMAND "${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/windows/signtool.py") set(PERFORM_SIGNING 0) if (EXISTS ${PFX_FILE}) From 0e77993fe21c017a830fdf9da11f1e5703701a92 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 21 Feb 2020 19:10:42 +0100 Subject: [PATCH 10/11] Update SDK for freezing video stream fix --- linphone-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linphone-sdk b/linphone-sdk index 0afeab621..bff2ab076 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 0afeab62189ccf8dc5d9a8dace2968efc53bf60a +Subproject commit bff2ab0768b4f6b0f8fc73d02acd61ca3360ff82 From df482aab7a22a360da15e9575144e5e4fac019be Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Fri, 21 Feb 2020 19:25:26 +0100 Subject: [PATCH 11/11] Correct installation for Linux --- CMakeLists.txt | 2 +- cmake_builder/linphone_package/CMakeLists.txt | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 618b2a811..93a4df9b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -480,7 +480,7 @@ else() if(APPLE) set(PACKAGING_DIR "${APPLICATION_NAME}.app/Contents/Resources") else() - set(PACKAGING_DIR "") + set(PACKAGING_DIR "${CMAKE_INSTALL_PREFIX}") endif() install(FILES "${ASSETS_DIR}/linphonerc-factory" DESTINATION "${PACKAGING_DIR}/${CMAKE_INSTALL_DATADIR}/${APPLICATION_NAME}" diff --git a/cmake_builder/linphone_package/CMakeLists.txt b/cmake_builder/linphone_package/CMakeLists.txt index 507cacf2e..672a179bc 100644 --- a/cmake_builder/linphone_package/CMakeLists.txt +++ b/cmake_builder/linphone_package/CMakeLists.txt @@ -184,22 +184,24 @@ else()# Not Windows and Apple message("Changing RPATH of ${LIBRARY_FILENAME} from '${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}' to '$ORIGIN/../${CMAKE_INSTALL_LIBDIR}'") execute_process(COMMAND install_name_tool -rpath "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}" "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}" "${LIBRARY}") endforeach () - install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}/" DESTINATION "${CMAKE_INSTALL_BINDIR}" USE_SOURCE_PERMISSIONS) + message(${CMAKE_INSTALL_PREFIX}) + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}" USE_SOURCE_PERMISSIONS) #Just in case. This is useless because we have to use CMAKE_INSTALL_LIBDIR if( EXISTS "${LINPHONE_OUTPUT_DIR}/lib/") - install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/" DESTINATION "lib" USE_SOURCE_PERMISSIONS) + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib/" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" USE_SOURCE_PERMISSIONS) endif() if( EXISTS "${LINPHONE_OUTPUT_DIR}/lib64/") - install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib64/" DESTINATION "lib64" USE_SOURCE_PERMISSIONS) + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/lib64/" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib64" USE_SOURCE_PERMISSIONS) endif() - install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS) + install(DIRECTORY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}" USE_SOURCE_PERMISSIONS) if (EXISTS "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer") - file(COPY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer" DESTINATION "${CMAKE_INSTALL_LIBDIR}" USE_SOURCE_PERMISSIONS) + file(COPY "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/mediastreamer" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" USE_SOURCE_PERMISSIONS) endif () - install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/cpim_grammar" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/") - install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/vcard_grammar" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/") - install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/linphone/rootca.pem" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${APPLICATION_NAME}") #We use executable_name because of name folder that is not harmonized from the SDK + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/cpim_grammar" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/") + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/vcard_grammar" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/belr/grammars/") + install(FILES "${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/linphone/rootca.pem" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/${APPLICATION_NAME}") #We use executable_name because of name folder that is not harmonized from the SDK + install(PROGRAMS "${CMAKE_BINARY_DIR}/${EXECUTABLE_NAME}" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}" COMPONENT application) endif () # Temporary deactivate