From 305fe70370a44de9b66d4ace917cf1ddc23c3b0d Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 3 Aug 2023 11:46:54 +0200 Subject: [PATCH] Update CMakeLists.txt so that linphone-sdk is added as a subdirectory of the project. --- .gitignore | 1 + CMakeLists.txt | 434 ++++++++------------ linphone-app/CMakeLists.txt | 55 ++- linphone-app/cmake/FindBcToolbox.cmake | 67 +++ linphone-app/cmake/FindBelcard.cmake | 43 ++ linphone-app/cmake/FindLinphone.cmake | 43 ++ linphone-app/cmake/FindLinphoneCxx.cmake | 43 ++ linphone-app/cmake/FindMediastreamer2.cmake | 46 +++ linphone-app/cmake/FindOrtp.cmake | 43 ++ linphone-sdk | 2 +- 10 files changed, 503 insertions(+), 274 deletions(-) create mode 100644 linphone-app/cmake/FindBcToolbox.cmake create mode 100644 linphone-app/cmake/FindBelcard.cmake create mode 100644 linphone-app/cmake/FindLinphone.cmake create mode 100644 linphone-app/cmake/FindLinphoneCxx.cmake create mode 100644 linphone-app/cmake/FindMediastreamer2.cmake create mode 100644 linphone-app/cmake/FindOrtp.cmake diff --git a/.gitignore b/.gitignore index 3a678c7ca..53c9905be 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ build-*-Debug build-*-Default prepare.conf.user build/* +CMakeUserPresets.json # Tags ------------------------------------------------------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8acf308bc..72b6f7562 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ ################################################################################ # -# Copyright (c) 2010-2020 Belledonne Communications SARL. +# Copyright (c) 2010-2023 Belledonne Communications SARL. # # This file is part of linphone-desktop # (see https://www.linphone.org). @@ -20,7 +20,7 @@ # ################################################################################ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.22) get_cmake_property(vars CACHE_VARIABLES) foreach(var ${vars}) @@ -57,26 +57,6 @@ include(CheckCXXCompilerFlag) set(CMAKE_CXX_STANDARD 17) -# Prepare gobal CMAKE configuration specific to the current project -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") -set(QTKEYCHAIN_OUTPUT_DIR "${CMAKE_BINARY_DIR}/qtkeychain") -set(QTKEYCHAIN_TARGET_NAME "EQt5Keychain") -set(APPLICATION_OUTPUT_DIR "${CMAKE_BINARY_DIR}/OUTPUT") - -set(CMAKE_PREFIX_PATH "${LINPHONE_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR};${APPLICATION_OUTPUT_DIR}/include${PREFIX_PATH}") -if(WIN32) - set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_OUTPUT_DIR}/${CMAKE_INSTALL_BINDIR}") -elseif(APPLE) - set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_NAME}.app/Contents/Frameworks") -else() - set( CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${APPLICATION_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}") -endif() -list(APPEND CMAKE_PREFIX_PATH "${QTKEYCHAIN_OUTPUT_DIR}/lib64/cmake") -list(APPEND CMAKE_PREFIX_PATH "${QTKEYCHAIN_OUTPUT_DIR}/lib/cmake") -string(REPLACE ";" "|" PREFIX_PATH "${CMAKE_PREFIX_PATH}") -#set(PREFIX_PATH "${LINPHONE_OUTPUT_DIR}|${APPLICATION_OUTPUT_DIR}${PREFIX_PATH}") - # Avoid cmake warning if CMP0071 is not set. if (POLICY CMP0071) cmake_policy(SET CMP0071 NEW) @@ -84,6 +64,13 @@ endif () #set_property(GLOBAL PROPERTY USE_FOLDERS ON) #------------------------------------------------------------------------------ +# Prepare gobal CMAKE configuration specific to the current project + +# GMA: set(QTKEYCHAIN_TARGET_NAME "EQt5Keychain") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/OUTPUT" CACHE PATH "Default linphone-app installation prefix" FORCE) + set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE) +endif() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified") @@ -99,255 +86,190 @@ endif() # SET OPTIONS #------------------------------------------------------------------------------- -option(ENABLE_APP_LICENSE "Enable the license in packages." YES) -option(ENABLE_APP_OAUTH2 "Build with OAuth2 support for remote provisioning." OFF) #Experimental. -option(ENABLE_APP_PACKAGING "Enable packaging" NO) -option(ENABLE_APP_PACKAGE_ROOTCA "Embed the rootca file into the package" YES) -option(ENABLE_APP_PDF_VIEWER "Enable Pdf viewer" YES) -option(ENABLE_APP_WEBVIEW "Enable webviews." NO) #Webview is not fully supported because of deployments. Used for subscription. -option(ENABLE_BUILD_APP_PLUGINS "Enable the build of plugins" YES) -option(ENABLE_BUILD_EXAMPLES "Enable the build of examples" NO) -option(ENABLE_BUILD_VERBOSE "Enable the build generation to be more verbose" NO) -option(ENABLE_DAEMON "Enable the linphone daemon interface." NO) -option(ENABLE_FFMPEG "Build mediastreamer2 with ffmpeg video support." NO)# No more needed +option(ENABLE_APP_LICENSE "Enable the license in packages." ON) +option(ENABLE_APP_OAUTH2 "Build with OAuth2 support for remote provisioning." OFF) # Experimental. +option(ENABLE_APP_PACKAGING "Enable packaging" OFF) +option(ENABLE_APP_PACKAGE_ROOTCA "Embed the rootca file into the package" ON) +option(ENABLE_APP_PDF_VIEWER "Enable Pdf viewer" ON) +option(ENABLE_APP_WEBVIEW "Enable webviews." OFF) # Webview is not fully supported because of deployments. Used for subscription. +option(ENABLE_BUILD_APP_PLUGINS "Enable the build of plugins" ON) +option(ENABLE_BUILD_EXAMPLES "Enable the build of examples" OFF) +option(ENABLE_BUILD_VERBOSE "Enable the build generation to be more verbose" OFF) option(ENABLE_QT_KEYCHAIN "Build QtKeychain to manage VFS from System key stores." ON) -option(ENABLE_QRCODE "Enable QRCode support" NO)#Experimental -option(ENABLE_SANITIZER "Enable sanitizer." NO) -option(ENABLE_STRICT "Build with strict compilator flags e.g. -Wall -Werror" NO) -option(ENABLE_TESTS "Build with testing binaries of SDK" NO ) -option(ENABLE_TESTS_COMPONENTS "Build libbctoolbox-tester" NO ) -option(ENABLE_TOOLS "Enable tools of SDK" NO) -option(ENABLE_UNIT_TESTS "Enable unit test of SDK." NO ) -option(ENABLE_UPDATE_CHECK "Enable update check." YES) - -option(ENABLE_OPENH264 "Enable the use of OpenH264 codec" YES) -option(ENABLE_NON_FREE_CODECS "Enable the use of non free codecs" YES) - -option(ENABLE_VIDEO "Enable Video support." YES) -option(ENABLE_LDAP "Enable LDAP support." YES) - -option(ENABLE_CONSOLE_UI "Turn on or off compilation of console interface." NO) - - +option(ENABLE_UPDATE_CHECK "Enable update check." ON) option(LINPHONE_SDK_MAKE_RELEASE_FILE_URL "Make a RELEASE file that work along check_version and use this URL" "") +option(ENABLE_RELATIVE_PREFIX "Set Internal packages relative to the binary" ON) +# QtKeychain +option(LIBSECRET_SUPPORT "Build with libsecret support" OFF) # Need libsecret-devel +# Set some SDK variables to configure the APP build as we want it +set(ENABLE_CONSOLE_UI OFF) +set(ENABLE_CXX_WRAPPER ON CACHE BOOL "Build the C++ wrapper for Liblinphone." FORCE) +set(ENABLE_DAEMON OFF) +set(ENABLE_FFMPEG OFF) +set(ENABLE_LDAP ON) +set(ENABLE_NON_FREE_CODECS ON) +set(ENABLE_OPENH264 ON) +set(ENABLE_QRCODE OFF) # Experimental +set(ENABLE_SANITIZER OFF) +set(ENABLE_STRICT OFF) +set(ENABLE_TESTS_COMPONENT OFF) +set(ENABLE_TOOLS OFF) +set(ENABLE_VIDEO ON) if(WIN32) - option(ENABLE_OPENSSL_EXPORT "Enable OpenSSL deployment" YES) + set(ENABLE_OPENSSL_EXPORT ON) elseif(APPLE) - option(ENABLE_OPENSSL_EXPORT "Enable OpenSSL deployment" NO) + set(ENABLE_OPENSSL_EXPORT OFF) else() - option(ENABLE_V4L "Ability to capture and display video using libv4l2 or libv4l." YES) - option(ENABLE_OPENSSL_EXPORT "Enable OpenSSL deployment" NO) + set(ENABLE_V4L ON) + set(ENABLE_OPENSSL_EXPORT OFF) endif() -option(ENABLE_RELATIVE_PREFIX "Set Internal packages relative to the binary" YES) -#QtKeychain -option(LIBSECRET_SUPPORT "Build with libsecret support" OFF) #Need libsecret-devel - -set(APP_OPTIONS "-DENABLE_UPDATE_CHECK=${ENABLE_UPDATE_CHECK}") -list(APPEND APP_OPTIONS "-DENABLE_APP_LICENSE=${ENABLE_APP_LICENSE}") -list(APPEND APP_OPTIONS "-DENABLE_APP_OAUTH2=${ENABLE_APP_OAUTH2}") -list(APPEND APP_OPTIONS "-DENABLE_APP_PACKAGING=${ENABLE_APP_PACKAGING}") -list(APPEND APP_OPTIONS "-DENABLE_APP_PACKAGE_ROOTCA=${ENABLE_APP_PACKAGE_ROOTCA}") -list(APPEND APP_OPTIONS "-DENABLE_APP_PDF_VIEWER=${ENABLE_APP_PDF_VIEWER}") -list(APPEND APP_OPTIONS "-DENABLE_APP_WEBVIEW=${ENABLE_APP_WEBVIEW}") -list(APPEND APP_OPTIONS "-DENABLE_BUILD_EXAMPLES=${ENABLE_BUILD_EXAMPLES}") -list(APPEND APP_OPTIONS "-DENABLE_BUILD_VERBOSE=${ENABLE_BUILD_VERBOSE}") -list(APPEND APP_OPTIONS "-DENABLE_CONSOLE_UI=${ENABLE_CONSOLE_UI}") -list(APPEND APP_OPTIONS "-DENABLE_DAEMON=${ENABLE_DAEMON}") -list(APPEND APP_OPTIONS "-DENABLE_FFMPEG=${ENABLE_FFMPEG}") -list(APPEND APP_OPTIONS "-DENABLE_FLEXIAPI=ON") -list(APPEND APP_OPTIONS "-DENABLE_LDAP=${ENABLE_LDAP}") -list(APPEND APP_OPTIONS "-DENABLE_NON_FREE_CODECS=${ENABLE_NON_FREE_CODECS}") -list(APPEND APP_OPTIONS "-DENABLE_OPENH264=${ENABLE_OPENH264}") -list(APPEND APP_OPTIONS "-DENABLE_OPENH264=${ENABLE_OPENH264}") -list(APPEND APP_OPTIONS "-DENABLE_QT_KEYCHAIN=${ENABLE_QT_KEYCHAIN}") -list(APPEND APP_OPTIONS "-DENABLE_OPENSSL_EXPORT=${ENABLE_OPENSSL_EXPORT}") -list(APPEND APP_OPTIONS "-DENABLE_QRCODE=${ENABLE_QRCODE}") -list(APPEND APP_OPTIONS "-DENABLE_SANITIZER=${ENABLE_SANITIZER}") -list(APPEND APP_OPTIONS "-DENABLE_STRICT=${ENABLE_STRICT}") -list(APPEND APP_OPTIONS "-DENABLE_TESTS=${ENABLE_TESTS}") -list(APPEND APP_OPTIONS "-DENABLE_TESTS_COMPONENTS=${ENABLE_TESTS_COMPONENTS}") -list(APPEND APP_OPTIONS "-DENABLE_TOOLS=${ENABLE_TOOLS}") -list(APPEND APP_OPTIONS "-DENABLE_UNIT_TESTS=${ENABLE_UNIT_TESTS}") -list(APPEND APP_OPTIONS "-DENABLE_VIDEO=${ENABLE_VIDEO}") - -if(LINPHONE_SDK_MAKE_RELEASE_FILE_URL) - list(APPEND APP_OPTIONS "-DLINPHONE_SDK_MAKE_RELEASE_FILE_URL=${LINPHONE_SDK_MAKE_RELEASE_FILE_URL}") -endif() - -if(LINPHONESDK_MACOS_ARCHS) - list(APPEND APP_OPTIONS "-DLINPHONESDK_MACOS_ARCHS=${LINPHONESDK_MACOS_ARCHS}") -endif() - -if(ENABLE_V4L) - list(APPEND APP_OPTIONS "-DENABLE_V4L=${ENABLE_V4L}") -endif() -list(APPEND APP_OPTIONS "-DENABLE_RELATIVE_PREFIX=${ENABLE_RELATIVE_PREFIX}") - -list(APPEND APP_OPTIONS "-DLINPHONE_OUTPUT_DIR=${LINPHONE_OUTPUT_DIR}") -list(APPEND APP_OPTIONS "-DQTKEYCHAIN_OUTPUT_DIR=${QTKEYCHAIN_OUTPUT_DIR}") -list(APPEND APP_OPTIONS "-DQTKEYCHAIN_TARGET_NAME=${QTKEYCHAIN_TARGET_NAME}") - -list(APPEND APP_OPTIONS "-DENABLE_QT_GL=${ENABLE_VIDEO}")#Activate on video - -include(ExternalProject) -set(PROJECT_BUILD_COMMAND "") -if(CMAKE_BUILD_PARALLEL_LEVEL) - list(APPEND APP_OPTIONS "-DCMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}") - if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") #CMAKE_BUILD_PARALLEL_LEVEL will not always work for External projects - list(APPEND PROJECT_BUILD_COMMAND "--parallel" "${CMAKE_BUILD_PARALLEL_LEVEL}") - endif() -endif() -if(CMAKE_VERBOSE_MAKEFILE) - list(APPEND APP_OPTIONS "-DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE}") - if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14.0") - list(APPEND PROJECT_BUILD_COMMAND "--verbose") - endif() -endif() -if(UNIX AND NOT APPLE) - set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib64:$ORIGIN/../lib64:$ORIGIN/lib:$ORIGIN/../lib:${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}") - list(APPEND APP_OPTIONS "-DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}") -elseif(APPLE) - list(APPEND APP_OPTIONS "-DENABLE_FAT_BINARY=ON") #Disable XCFrameworks as it is not supported. -endif() -if(CMAKE_OSX_DEPLOYMENT_TARGET) - list(APPEND APP_OPTIONS "-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}") -endif() -list(APPEND APP_OPTIONS "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}") - -set(QTKEYCHAIN_OPTIONS "-DLIBSECRET_SUPPORT=${LIBSECRET_SUPPORT}") -list(APPEND QTKEYCHAIN_OPTIONS "-DQTKEYCHAIN_TARGET_NAME=${QTKEYCHAIN_TARGET_NAME}") - -if(ENABLE_BUILD_APP_PLUGINS) - file(GLOB children "plugins/*") - set(dirlist "") - foreach(child ${children}) - if(IS_DIRECTORY ${curdir}/${child} AND (ENABLE_BUILD_EXAMPLES OR NOT ${child} MATCHES "example")) - list(APPEND dirlist ${child}) - endif() - endforeach() - list(LENGTH dirlist count) - if(NOT count) - set(ENABLE_BUILD_APP_PLUGINS OFF) - message(STATUS "No plugins found for the application to build") - endif() -endif() - -if(NOT LINPHONE_QT_ONLY) -#add_subdirectory(external/qtkeychain) - if(ENABLE_QT_KEYCHAIN) - ExternalProject_Add(app-qtkeychain PREFIX "${CMAKE_BINARY_DIR}/qtkeychain" - SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/qtkeychain" - INSTALL_DIR "${QTKEYCHAIN_OUTPUT_DIR}" - BINARY_DIR "${SDK_BUILD_DIR}/qtkeychain" - BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS ${APP_OPTIONS} ${QTKEYCHAIN_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -DCMAKE_OSX_ARCHITECTURES=${LINPHONESDK_MACOS_ARCHS} - BUILD_ALWAYS NO #${DO_BUILD} - ) - endif() - ExternalProject_Add(sdk PREFIX "${CMAKE_BINARY_DIR}/sdk" - SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-sdk" - INSTALL_DIR "${LINPHONE_OUTPUT_DIR}" - STAMP_DIR "${SDK_BUILD_DIR}/stamp" - BINARY_DIR "${SDK_BUILD_DIR}" - STEP_TARGETS build - BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} - INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -DCMAKE_OSX_ARCHITECTURES=${LINPHONESDK_MACOS_ARCHS} - BUILD_ALWAYS NO #${DO_BUILD} - ) - ExternalProject_Add_Step(sdk force_build - COMMENT "Forcing build for 'sdk'" - DEPENDEES configure - DEPENDERS build - ALWAYS 1 - ) -endif() -include(FindPkgConfig) - -set(APP_DEPENDS sdk)# Used if NOT LINPHONE_QT_ONLY -if(ENABLE_QT_KEYCHAIN) - list(APPEND APP_DEPENDS app-qtkeychain) -endif() find_package(Qt5 5.10 COMPONENTS Core REQUIRED) -if ( NOT Qt5_FOUND ) +if(NOT Qt5_FOUND) message(FATAL_ERROR "Minimum supported Qt5 version is 5.10!") endif() -find_package(LinphoneCxx CONFIG QUIET) -find_package(Linphone CONFIG QUIET) -find_package(bctoolbox CONFIG QUIET) -find_package(belcard CONFIG QUIET) -find_package(Mediastreamer2 CONFIG QUIET) -find_package(ortp CONFIG QUIET) -find_package(${QTKEYCHAIN_TARGET_NAME} CONFIG QUIET) -if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) - OR ( ENABLE_QT_KEYCHAIN AND NOT(${QTKEYCHAIN_TARGET_NAME}_FOUND) ) - OR FORCE_APP_EXTERNAL_PROJECTS -) - message("Projects are set as External projects. You can start building them by using for example : cmake --build . --target install") - ExternalProject_Add(linphone-qt PREFIX "${CMAKE_BINARY_DIR}/linphone-app" - SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" - INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" - BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" - DEPENDS ${APP_DEPENDS} - BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} - INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -DCMAKE_OSX_ARCHITECTURES=${LINPHONESDK_MACOS_ARCHS} - # ${APP_OPTIONS} - BUILD_ALWAYS ON - ) - if( ENABLE_BUILD_APP_PLUGINS) - ExternalProject_Add(app-plugins PREFIX "${CMAKE_BINARY_DIR}/plugins-app" - SOURCE_DIR "${CMAKE_SOURCE_DIR}/plugins" - INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" - BINARY_DIR "${CMAKE_BINARY_DIR}/plugins-app" - DEPENDS linphone-qt - BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} - INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -DCMAKE_OSX_ARCHITECTURES=${LINPHONESDK_MACOS_ARCHS} - ) +function(add_linphone_sdk) + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) # Prevent project from overriding the options we just set here + add_subdirectory("linphone-sdk") +endfunction() +add_linphone_sdk() + +function(add_linphone_app) + if(APPLE) + add_compile_definitions("ENABLE_FAT_BINARY=ON") # Disable XCFrameworks as it is not supported. + elseif(UNIX) + # GMA: set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib64:$ORIGIN/../lib64:$ORIGIN/lib:$ORIGIN/../lib:${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}") + set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib64:$ORIGIN/../lib64:$ORIGIN/lib:$ORIGIN/../lib") endif() - install(CODE "message(STATUS \"Running install\")") - set(AUTO_REGENERATION auto_regeneration) - if( ENABLE_BUILD_APP_PLUGINS) - add_custom_target(${AUTO_REGENERATION} ALL - COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS app-plugins) - else() - add_custom_target(${AUTO_REGENERATION} ALL - COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS linphone-qt) - endif() -else() - message("Adding Linphone Desktop in an IDE-friendly state") - set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") - add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) - if(NOT LINPHONE_QT_ONLY) - add_dependencies(app-library ${APP_DEPENDS}) - endif() - if( ENABLE_BUILD_APP_PLUGINS) - add_subdirectory(${CMAKE_SOURCE_DIR}/plugins "plugins-app") - endif() -endif() -ExternalProject_Add(linphone-qt-only PREFIX "${CMAKE_BINARY_DIR}/linphone-app" - SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" - INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" - BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" - BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} -# INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." - LIST_SEPARATOR | # Use the alternate list separator - CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} -DCMAKE_OSX_ARCHITECTURES=${LINPHONESDK_MACOS_ARCHS} - EXCLUDE_FROM_ALL ON - #BUILD_ALWAYS ON -) + + add_subdirectory("linphone-app") +endfunction() +add_linphone_app() + + +# if(ENABLE_BUILD_APP_PLUGINS) +# file(GLOB children "plugins/*") +# set(dirlist "") +# foreach(child ${children}) +# if(IS_DIRECTORY ${curdir}/${child} AND (ENABLE_BUILD_EXAMPLES OR NOT ${child} MATCHES "example")) +# list(APPEND dirlist ${child}) +# endif() +# endforeach() +# list(LENGTH dirlist count) +# if(NOT count) +# set(ENABLE_BUILD_APP_PLUGINS OFF) +# message(STATUS "No plugins found for the application to build") +# endif() +# endif() + + +# if(NOT LINPHONE_QT_ONLY) +# #add_subdirectory(external/qtkeychain) +# if(ENABLE_QT_KEYCHAIN) +# ExternalProject_Add(app-qtkeychain PREFIX "${CMAKE_BINARY_DIR}/qtkeychain" +# SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/qtkeychain" +# INSTALL_DIR "${QTKEYCHAIN_OUTPUT_DIR}" +# BINARY_DIR "${SDK_BUILD_DIR}/qtkeychain" +# BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} +# LIST_SEPARATOR | # Use the alternate list separator +# CMAKE_ARGS ${APP_OPTIONS} ${QTKEYCHAIN_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +# BUILD_ALWAYS NO #${DO_BUILD} +# ) +# endif() +# ExternalProject_Add(sdk PREFIX "${CMAKE_BINARY_DIR}/sdk" +# SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-sdk" +# INSTALL_DIR "${LINPHONE_OUTPUT_DIR}" +# STAMP_DIR "${SDK_BUILD_DIR}/stamp" +# BINARY_DIR "${SDK_BUILD_DIR}" +# STEP_TARGETS build +# BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} +# INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." +# LIST_SEPARATOR | # Use the alternate list separator +# CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +# BUILD_ALWAYS NO #${DO_BUILD} +# ) +# ExternalProject_Add_Step(sdk force_build +# COMMENT "Forcing build for 'sdk'" +# DEPENDEES configure +# DEPENDERS build +# ALWAYS 1 +# ) +# endif() +# include(FindPkgConfig) + +# set(APP_DEPENDS sdk)# Used if NOT LINPHONE_QT_ONLY +# if(ENABLE_QT_KEYCHAIN) +# list(APPEND APP_DEPENDS app-qtkeychain) +# endif() + +# find_package(${QTKEYCHAIN_TARGET_NAME} CONFIG QUIET) + +# if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) +# OR ( ENABLE_QT_KEYCHAIN AND NOT(${QTKEYCHAIN_TARGET_NAME}_FOUND) ) +# OR FORCE_APP_EXTERNAL_PROJECTS +# ) +# message("Projects are set as External projects. You can start building them by using for example : cmake --build . --target install") +# ExternalProject_Add(linphone-qt PREFIX "${CMAKE_BINARY_DIR}/linphone-app" +# SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" +# INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" +# BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" +# DEPENDS ${APP_DEPENDS} +# BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} +# INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." +# LIST_SEPARATOR | # Use the alternate list separator +# CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +# # ${APP_OPTIONS} +# BUILD_ALWAYS ON +# ) +# if( ENABLE_BUILD_APP_PLUGINS) +# ExternalProject_Add(app-plugins PREFIX "${CMAKE_BINARY_DIR}/plugins-app" +# SOURCE_DIR "${CMAKE_SOURCE_DIR}/plugins" +# INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" +# BINARY_DIR "${CMAKE_BINARY_DIR}/plugins-app" +# DEPENDS linphone-qt +# BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} +# INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." +# LIST_SEPARATOR | # Use the alternate list separator +# CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +# ) +# endif() +# install(CODE "message(STATUS \"Running install\")") +# set(AUTO_REGENERATION auto_regeneration) +# if( ENABLE_BUILD_APP_PLUGINS) +# add_custom_target(${AUTO_REGENERATION} ALL +# COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} +# DEPENDS app-plugins) +# else() +# add_custom_target(${AUTO_REGENERATION} ALL +# COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} +# DEPENDS linphone-qt) +# endif() +# else() +# message("Adding Linphone Desktop in an IDE-friendly state") +# set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") +# add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) +# if(NOT LINPHONE_QT_ONLY) +# add_dependencies(app-library ${APP_DEPENDS}) +# endif() +# if( ENABLE_BUILD_APP_PLUGINS) +# add_subdirectory(${CMAKE_SOURCE_DIR}/plugins "plugins-app") +# endif() +# endif() +# ExternalProject_Add(linphone-qt-only PREFIX "${CMAKE_BINARY_DIR}/linphone-app" +# SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" +# INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" +# BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" +# BUILD_COMMAND ${CMAKE_COMMAND} --build --config $ ${PROJECT_BUILD_COMMAND} +# # INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." +# LIST_SEPARATOR | # Use the alternate list separator +# CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +# EXCLUDE_FROM_ALL ON +# #BUILD_ALWAYS ON +# ) diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt index 764b4001e..d9b987833 100644 --- a/linphone-app/CMakeLists.txt +++ b/linphone-app/CMakeLists.txt @@ -1,6 +1,6 @@ ################################################################################ # -# Copyright (c) 2017-2021 Belledonne Communications SARL. +# Copyright (c) 2017-2023 Belledonne Communications SARL. # # This file is part of linphone-desktop # (see https://www.linphone.org). @@ -19,9 +19,15 @@ # along with this program. If not, see . # ################################################################################ -cmake_minimum_required(VERSION 3.1) -find_package(bctoolbox CONFIG) +cmake_minimum_required(VERSION 3.22) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + +find_package(BcToolbox) +if(NOT BCTOOLBOX_FOUND) + find_package(bctoolbox CONFIG) +endif() set(FULL_VERSION ) bc_compute_full_version(FULL_VERSION) set(version_major ) @@ -81,16 +87,31 @@ if(WIN32) endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES ) endif() -find_package(LinphoneCxx CONFIG) -find_package(Linphone CONFIG) -find_package(belcard CONFIG) -find_package(Mediastreamer2 CONFIG) -find_package(ortp CONFIG) - -if(ENABLE_QT_KEYCHAIN) - find_package(${QTKEYCHAIN_TARGET_NAME} CONFIG REQUIRED) - add_definitions(-DENABLE_QT_KEYCHAIN) +find_package(Ortp) +if(NOT ORTP_FOUND) + find_package(ortp CONFIG) endif() +find_package(Mediastreamer2) +if(NOT MEDIASTREAMER2_FOUND) + find_package(Mediastreamer2 CONFIG) +endif() +find_package(Belcard) +if(NOT BELCARD_FOUND) + find_package(belcard CONFIG) +endif() +find_package(Linphone) +if(NOT LINPHONE_FOUND) + find_package(Linphone CONFIG) +endif() +find_package(LinphoneCxx) +if(NOT LINPHONECXX_FOUND) + find_package(LinphoneCxx CONFIG) +endif() + +# if(ENABLE_QT_KEYCHAIN) +# find_package(${QTKEYCHAIN_TARGET_NAME} CONFIG REQUIRED) +# add_definitions(-DENABLE_QT_KEYCHAIN) +# endif() if(ENABLE_BUILD_VERBOSE) message("INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} FRAMEWORK_PATH=${CMAKE_FRAMEWORK_PATH}, PREFIX_PATH=${CMAKE_PREFIX_PATH}") @@ -587,11 +608,11 @@ endforeach () # Init git hooks. # ------------------------------------------------------------------------------ -if (NOT WIN32) +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 @@ -756,7 +777,7 @@ if(WIN32) target_link_libraries(${TARGET_NAME} wsock32 ws2_32 ${LDAP_LIBRARIES} ${LBER_LIBRARIES}) endif() -add_dependencies(${APP_LIBRARY} update_translations ${TARGET_NAME}-git-version ${APP_PLUGIN}) +add_dependencies(${APP_LIBRARY} update_translations ${TARGET_NAME}-git-version ${APP_PLUGIN}) add_dependencies(${TARGET_NAME} ${APP_LIBRARY} ${APP_PLUGIN}) @@ -783,9 +804,9 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include" DESTINATION ".") add_subdirectory(build) -add_subdirectory(cmake_builder/linphone_package) +# GMA: TODO add_subdirectory(cmake_builder/linphone_package) -deployqt_hack(${TARGET_NAME} ${LINPHONE_QML_DIR}) +# GMA: TODO deployqt_hack(${TARGET_NAME} ${LINPHONE_QML_DIR}) # ------------------------------------------------------------------------------ diff --git a/linphone-app/cmake/FindBcToolbox.cmake b/linphone-app/cmake/FindBcToolbox.cmake new file mode 100644 index 000000000..57664786f --- /dev/null +++ b/linphone-app/cmake/FindBcToolbox.cmake @@ -0,0 +1,67 @@ +############################################################################ +# FindBctoolbox.cmake +# Copyright (C) 2023 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. +# +############################################################################ +# +# - Find the bctoolbox include files and library +# +# BCTOOLBOX_FOUND - System has lib bctoolbox +# BCTOOLBOX_INCLUDE_DIRS - The bctoolbox include directories +# BCTOOLBOX_LIBRARIES - The libraries needed to use bctoolbox +# BCTOOLBOX_CMAKE_DIR - The bctoolbox cmake directory +# BCTOOLBOX_CORE_FOUND - System has core bctoolbox +# BCTOOLBOX_CORE_INCLUDE_DIRS - The core bctoolbox include directories +# BCTOOLBOX_CORE_LIBRARIES - The core bctoolbox libraries +# BCTOOLBOX_TESTER_FOUND - System has bctoolbox tester +# BCTOOLBOX_TESTER_INCLUDE_DIRS - The bctoolbox tester include directories +# BCTOOLBOX_TESTER_LIBRARIES - The bctoolbox tester libraries + +if(TARGET bctoolbox) + + set(BCTOOLBOX_CORE_LIBRARIES bctoolbox) + get_target_property(BCTOOLBOX_CORE_INCLUDE_DIRS bctoolbox INTERFACE_INCLUDE_DIRECTORIES) + set(BCTOOLBOX_CORE_FOUND TRUE) + get_target_property(BCTOOLBOX_SOURCE_DIR bctoolbox SOURCE_DIR) + set(BCTOOLBOX_CMAKE_DIR "${BCTOOLBOX_SOURCE_DIR}/../cmake") + if(TARGET bctoolbox-tester) + set(BCTOOLBOX_TESTER_LIBRARIES bctoolbox-tester) + get_target_property(BCTOOLBOX_TESTER_INCLUDE_DIRS bctoolbox-tester INTERFACE_INCLUDE_DIRECTORIES) + set(BCTOOLBOX_TESTER_FOUND TRUE) + set(BCTOOLBOX_TESTER_COMPONENT_VARIABLES BCTOOLBOX_TESTER_FOUND BCTOOLBOX_TESTER_INCLUDE_DIRS BCTOOLBOX_TESTER_LIBRARIES) + endif() + set(BCTOOLBOX_LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES} ${BCTOOLBOX_TESTER_LIBRARIES}) + set(BCTOOLBOX_INCLUDE_DIRS ${BCTOOLBOX_CORE_INCLUDE_DIRS} ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(BcToolbox + DEFAULT_MSG + BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR + BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES + ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} + ) + + mark_as_advanced( + BCTOOLBOX_INCLUDE_DIRS BCTOOLBOX_LIBRARIES BCTOOLBOX_CMAKE_DIR + BCTOOLBOX_CORE_FOUND BCTOOLBOX_CORE_INCLUDE_DIRS BCTOOLBOX_CORE_LIBRARIES + ${BCTOOLBOX_TESTER_COMPONENT_VARIABLES} + ) + +endif() diff --git a/linphone-app/cmake/FindBelcard.cmake b/linphone-app/cmake/FindBelcard.cmake new file mode 100644 index 000000000..f5a26151c --- /dev/null +++ b/linphone-app/cmake/FindBelcard.cmake @@ -0,0 +1,43 @@ +############################################################################ +# FindBelcard.cmake +# Copyright (C) 2023 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. +# +############################################################################ +# +# - Find the belcard include files and library +# +# BELCARD_FOUND - system has lib belcard +# BELCARD_INCLUDE_DIRS - the belcard include directory +# BELCARD_LIBRARIES - The library needed to use belcard + +if(TARGET belcard) + + set(BELCARD_LIBRARIES belcard) + get_target_property(BELCARD_INCLUDE_DIRS belcard INTERFACE_INCLUDE_DIRECTORIES) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Belcard + DEFAULT_MSG + BELCARD_INCLUDE_DIRS BELCARD_LIBRARIES + ) + + mark_as_advanced(BELCARD_INCLUDE_DIRS BELCARD_LIBRARIES) + +endif() diff --git a/linphone-app/cmake/FindLinphone.cmake b/linphone-app/cmake/FindLinphone.cmake new file mode 100644 index 000000000..31fbbb52c --- /dev/null +++ b/linphone-app/cmake/FindLinphone.cmake @@ -0,0 +1,43 @@ +############################################################################ +# FindLinphone.cmake +# Copyright (C) 2023 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. +# +############################################################################ +# +# - Find the linphone include files and library +# +# LINPHONE_FOUND - system has lib linphone +# LINPHONE_INCLUDE_DIRS - the linphone include directory +# LINPHONE_LIBRARIES - The library needed to use linphone + +if(TARGET linphone) + + set(LINPHONE_LIBRARIES linphone) + get_target_property(LINPHONE_INCLUDE_DIRS linphone INTERFACE_INCLUDE_DIRECTORIES) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Linphone + DEFAULT_MSG + LINPHONE_INCLUDE_DIRS LINPHONE_LIBRARIES + ) + + mark_as_advanced(LINPHONE_INCLUDE_DIRS LINPHONE_LIBRARIES) + +endif() diff --git a/linphone-app/cmake/FindLinphoneCxx.cmake b/linphone-app/cmake/FindLinphoneCxx.cmake new file mode 100644 index 000000000..99dacce40 --- /dev/null +++ b/linphone-app/cmake/FindLinphoneCxx.cmake @@ -0,0 +1,43 @@ +############################################################################ +# FindLinphoneCxx.cmake +# Copyright (C) 2023 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. +# +############################################################################ +# +# - Find the linphonecxx include files and library +# +# LINPHONECXX_FOUND - system has lib linphonecxx +# LINPHONECXX_INCLUDE_DIRS - the linphonecxx include directory +# LINPHONECXX_LIBRARIES - The library needed to use linphonecxx + +if(TARGET linphone++) + + set(LINPHONECXX_LIBRARIES linphone++) + get_target_property(LINPHONECXX_INCLUDE_DIRS linphone++ INTERFACE_INCLUDE_DIRECTORIES) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(LinphoneCxx + DEFAULT_MSG + LINPHONECXX_INCLUDE_DIRS LINPHONECXX_LIBRARIES + ) + + mark_as_advanced(LINPHONECXX_INCLUDE_DIRS LINPHONECXX_LIBRARIES) + +endif() diff --git a/linphone-app/cmake/FindMediastreamer2.cmake b/linphone-app/cmake/FindMediastreamer2.cmake new file mode 100644 index 000000000..60ed381ec --- /dev/null +++ b/linphone-app/cmake/FindMediastreamer2.cmake @@ -0,0 +1,46 @@ +############################################################################ +# FindMediastreamer2.cmake +# Copyright (C) 2023 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. +# +############################################################################ +# +# - Find the mediastreamer2 include files and library +# +# MEDIASTREAMER2_FOUND - system has lib mediastreamer2 +# MEDIASTREAMER2_INCLUDE_DIRS - the mediasteamer2 include directory +# MEDIASTREAMER2_LIBRARIES - The library needed to use mediasteamer2 +# MEDIASTREAMER2_PLUGINS_LOCATION - The location of the mediastreamer2 plugins + +if(TARGET mediastreamer) + + set(MEDIASTREAMER2_LIBRARIES mediastreamer) + get_target_property(MEDIASTREAMER2_INCLUDE_DIRS mediastreamer INTERFACE_INCLUDE_DIRECTORIES) + define_property(TARGET PROPERTY "MS2_PLUGINS" BRIEF_DOCS "Stores the location of mediastreamer2 plugins" FULL_DOCS "Stores the location of mediastreamer2 plugins") + get_target_property(MEDIASTREAMER2_PLUGINS_LOCATION mediastreamer MS2_PLUGINS) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Mediastreamer2 + DEFAULT_MSG + MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES + ) + + mark_as_advanced(MEDIASTREAMER2_INCLUDE_DIRS MEDIASTREAMER2_LIBRARIES) + +endif() diff --git a/linphone-app/cmake/FindOrtp.cmake b/linphone-app/cmake/FindOrtp.cmake new file mode 100644 index 000000000..13121fb4a --- /dev/null +++ b/linphone-app/cmake/FindOrtp.cmake @@ -0,0 +1,43 @@ +############################################################################ +# FindOrtp.cmake +# Copyright (C) 2023 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. +# +############################################################################ +# +# - Find the ortp include files and library +# +# ORTP_FOUND - system has lib ortp +# ORTP_INCLUDE_DIRS - the ortp include directory +# ORTP_LIBRARIES - The library needed to use ortp + +if(TARGET ortp) + + set(ORTP_LIBRARIES ortp) + get_target_property(ORTP_INCLUDE_DIRS ortp INTERFACE_INCLUDE_DIRECTORIES) + + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Ortp + DEFAULT_MSG + ORTP_INCLUDE_DIRS ORTP_LIBRARIES + ) + + mark_as_advanced(ORTP_INCLUDE_DIRS ORTP_LIBRARIES) + +endif() diff --git a/linphone-sdk b/linphone-sdk index 28018be13..9dd9d49dc 160000 --- a/linphone-sdk +++ b/linphone-sdk @@ -1 +1 @@ -Subproject commit 28018be135ef0b37132faf5b254e8dd861c583ff +Subproject commit 9dd9d49dc2757b816d7d084d2e361979585d6532