diff --git a/CMakeLists.txt b/CMakeLists.txt index a9a0e4dc4..5646aabf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -481,3 +481,11 @@ source_group( source_group( "Svg" REGULAR_EXPRESSION ".+\.svg$" ) + +# ------------------------------ +# Installation +# ------------------------------ +install(SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake_builder/install.cmake") +#endif () + + diff --git a/build_all_macos.sh b/build_all_macos.sh new file mode 100755 index 000000000..ad52bdef6 --- /dev/null +++ b/build_all_macos.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +#Stop at error +set -e + +if [[ -z ${Qt5_DIR} ]]; then + export Qt5_DIR=/usr/opt/qt/lib/cmake + export PATH=$PATH:/usr/local/opt/qt/bin +fi + +#Creation of folders +mkdir -p build-desktop +mkdir -p linphone-sdk/build-sdk +mkdir -p submodules/externals/minizip/build-minizip + +#SDK building +cd linphone-sdk/build-sdk +cmake .. -DLINPHONESDK_DOXYGEN_PROGRAM=/Applications/Doxygen.app/Contents/Resources/doxygen -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 +cmake --build . --target all --parallel 5 +rsync -a linphone-sdk/desktop/ ../../build-desktop/OUTPUT/ +cd ../.. +#MiniZip Building +cd submodules/externals/minizip/build-minizip +cmake .. -DCMAKE_INSTALL_PREFIX=../../../../build-desktop/OUTPUT -DCMAKE_PREFIX_PATH=../../../build-desktop/OUTPUT +cmake --build . --target all --parallel 5 +cmake --build . --target install +cd ../../../.. + +#Desktop Building +cd build-desktop +cmake .. -DCMAKE_INSTALL_PREFIX=OUTPUT +cmake --build . --target all +cmake --build . --target install + + + diff --git a/cmake_builder/CMakeLists.txt b/cmake_builder/CMakeLists.txt index 41882eb8e..d05733df3 100644 --- a/cmake_builder/CMakeLists.txt +++ b/cmake_builder/CMakeLists.txt @@ -1,6 +1,6 @@ ############################################################################ # CMakeLists.txt -# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France +# Copyright (C) 2017-2020 Belledonne Communications, Grenoble France # ############################################################################ # @@ -20,7 +20,7 @@ # ############################################################################ -lcb_define_target("linphoneqt" "linphone" "ms2plugins") +lcb_define_targets("linphoneqt" "linphone" "ms2plugins") #if (NOT WIN32 AND NOT APPLE) diff --git a/cmake_builder/install.cmake b/cmake_builder/install.cmake new file mode 100644 index 000000000..9e8f24776 --- /dev/null +++ b/cmake_builder/install.cmake @@ -0,0 +1,28 @@ +############################################################################ +# packaging.cmake +# 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. +# +############################################################################ + +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") +else () +endif ()