From f0a90ded71f0336ea6ac86f6a947faa2bee87203 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 25 Jan 2017 14:14:42 +0100 Subject: [PATCH] chore(app): integrate build of `linphone-qt` with `prepare.py` --- cmake_builder/CMakeLists.txt | 24 ++++++++++++++ cmake_builder/linphoneqt.cmake | 26 ++++++++++++++++ linphone-desktop/CMakeLists.txt | 55 ++++++++++++++++++++++++--------- prepare.conf | 2 +- prepare.py | 5 +++ 5 files changed, 97 insertions(+), 15 deletions(-) create mode 100644 cmake_builder/CMakeLists.txt create mode 100644 cmake_builder/linphoneqt.cmake diff --git a/cmake_builder/CMakeLists.txt b/cmake_builder/CMakeLists.txt new file mode 100644 index 000000000..c169e6129 --- /dev/null +++ b/cmake_builder/CMakeLists.txt @@ -0,0 +1,24 @@ +############################################################################ +# CMakeLists.txt +# Copyright (C) 2017 Belledonne Communications, Grenoble France +# +############################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################ + +lcb_define_target("linphoneqt" "linphone" "ms2plugins") + diff --git a/cmake_builder/linphoneqt.cmake b/cmake_builder/linphoneqt.cmake new file mode 100644 index 000000000..583873b95 --- /dev/null +++ b/cmake_builder/linphoneqt.cmake @@ -0,0 +1,26 @@ +############################################################################ +# linphoneqt.cmake +# Copyright (C) 2017 Belledonne Communications, Grenoble France +# +############################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################ + +lcb_external_source_paths("../linphone-desktop") + +lcb_dependencies("linphone") + diff --git a/linphone-desktop/CMakeLists.txt b/linphone-desktop/CMakeLists.txt index 36eaa4fa0..ba5e7716f 100644 --- a/linphone-desktop/CMakeLists.txt +++ b/linphone-desktop/CMakeLists.txt @@ -1,13 +1,33 @@ -# ============================================================================== +################################################################################ # CMakeLists.txt -# ============================================================================== +# Copyright (C) 2017 Belledonne Communications, Grenoble France +# +################################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +################################################################################ cmake_minimum_required(VERSION 3.1) -project(linphone) +project(linphoneqt) set(LINPHONE_EXEC linphone-qt) set(CMAKE_CXX_STANDARD 11) +include(GNUInstallDirs) + # Use automatically moc from Qt5. set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -38,18 +58,9 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARAT set(QT5_PACKAGES Core Gui Quick Widgets QuickControls2 LinguistTools) -set(LIBS) -foreach (package ${QT5_PACKAGES}) - # `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 LIBS "Qt5::${package}") - endif () -endforeach () - find_package(Linphone REQUIRED) -list(APPEND LIBS "${CMAKE_SOURCE_DIR}/../OUTPUT/desktop/lib64/liblinphone++.so") +set(LIBS "${CMAKE_SOURCE_DIR}/../OUTPUT/desktop/lib64/liblinphone++.so") set(SOURCES src/app/App.cpp @@ -168,7 +179,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E copy # Build. # ------------------------------------------------------------------------------ -find_package(Qt5 COMPONENTS ${QT5_PACKAGES}) +find_package(Qt5 COMPONENTS ${QT5_PACKAGES} REQUIRED) # Add languages support. add_subdirectory(${LANGUAGES_DIRECTORY}) @@ -184,5 +195,21 @@ add_dependencies(${LINPHONE_EXEC} update_translations) add_dependencies(update_translations check_qml) target_include_directories(${LINPHONE_EXEC} SYSTEM PRIVATE "${LINPHONE_INCLUDE_DIRS}") +foreach (package ${QT5_PACKAGES}) + target_include_directories(${LINPHONE_EXEC} SYSTEM PRIVATE "${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)) + target_link_libraries(${LINPHONE_EXEC} ${Qt5${package}_LIBRARIES}) + endif() +endforeach () target_link_libraries(${LINPHONE_EXEC} ${LIBS} ${LINPHONE_LIBRARIES}) + +install(TARGETS ${LINPHONE_EXEC} + 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 +) + diff --git a/prepare.conf b/prepare.conf index a4eecc31f..4919292c3 100644 --- a/prepare.conf +++ b/prepare.conf @@ -1,3 +1,3 @@ -DENABLE_CXX_WRAPPER=YES --DENABLE_JPEG=NO +-DENABLE_GTK_UI=NO diff --git a/prepare.py b/prepare.py index f3caf337d..bdd42b331 100755 --- a/prepare.py +++ b/prepare.py @@ -51,6 +51,11 @@ class DesktopTarget(prepare.Target): "-DCMAKE_SKIP_INSTALL_RPATH=YES", "-DENABLE_RELATIVE_PREFIX=YES" ] + external_builders_path = os.path.join(current_path, 'cmake_builder') + self.additional_args = [ + "-DLINPHONE_BUILDER_EXTERNAL_BUILDERS_PATH=" + external_builders_path, + "-DLINPHONE_BUILDER_TARGET=linphoneqt" + ] class DesktopRaspberryTarget(prepare.Target):