From 9001f40f1a0f80607eea9523005f6df8ca3bb64c Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 21 Dec 2015 14:45:59 +0100 Subject: [PATCH] Updated CMake files for belcard and belr --- CMakeLists.txt | 11 +++++++++ cmake/FindBelcard.cmake | 55 +++++++++++++++++++++++++++++++++++++++++ coreapi/CMakeLists.txt | 8 ++++++ tester/CMakeLists.txt | 1 + 4 files changed, 75 insertions(+) create mode 100644 cmake/FindBelcard.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index f4f45d39b..53186c8d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,8 @@ cmake_dependent_option(ENABLE_ASSISTANT "Turn on assistant compiling." YES "ENAB option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO) option(ENABLE_NLS "Build with internationalisation support" YES) option(ENABLE_CALL_LOGS_STORAGE "Turn on compilation of call logs storage." YES) +option(ENABLE_FRIENDS_SQL_STORAGE "Turn on compilation of friends sql storage." YES) +option(ENABLE_VCARD "Turn on compilation of vcard4 support." YES) macro(apply_compile_flags SOURCE_FILES) @@ -163,9 +165,15 @@ endif() if(ENABLE_CALL_LOGS_STORAGE) find_package(Sqlite3 REQUIRED) endif() +if (ENABLE_FRIENDS_SQL_STORAGE) + find_package(Sqlite3 REQUIRED) +endif() if(ENABLE_LIME) set(HAVE_LIME 1) endif() +if (ENABLE_VCARD) + find_package(Belcard REQUIRED) +endif() if(UNIX AND NOT APPLE) include(CheckIncludeFiles) @@ -200,6 +208,9 @@ if(SQLITE3_FOUND) if(ENABLE_CALL_LOGS_STORAGE) add_definitions("-DCALL_LOGS_STORAGE_ENABLED") endif() + if(ENABLE_FRIENDS_SQL_STORAGE) + add_definitions("-DFRIENDS_SQL_STORAGE_ENABLED") + endif() endif() if(INTL_FOUND) set(HAVE_INTL 1) diff --git a/cmake/FindBelcard.cmake b/cmake/FindBelcard.cmake new file mode 100644 index 000000000..810ed0d4e --- /dev/null +++ b/cmake/FindBelcard.cmake @@ -0,0 +1,55 @@ +############################################################################ +# FindBelcard.cmake +# Copyright (C) 2015 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ +# +# - Find the belcard include file and library +# +# BELCARD_FOUND - system has belcard +# BELCARD_INCLUDE_DIRS - the belcard include directory +# BELCARD_LIBRARIES - The libraries needed to use belcard + +set(_BELCARD_ROOT_PATHS + ${CMAKE_INSTALL_PREFIX} +) + +find_path(BELCARD_INCLUDE_DIRS + NAMES belcard.hpp + HINTS _BELCARD_ROOT_PATHS + PATH_SUFFIXES include +) + +if(BELCARD_INCLUDE_DIRS) + set(HAVE_BELCARD_H 1) +endif() + +find_library(BELCARD_LIBRARIES + NAMES belr belcard + HINTS ${_BELCARD_ROOT_PATHS} + PATH_SUFFIXES bin lib +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Belcard + DEFAULT_MSG + BELCARD_INCLUDE_DIRS BELCARD_LIBRARIES HAVE_BELCARD_H +) + +mark_as_advanced(BELCARD_INCLUDE_DIRS BELCARD_LIBRARIES HAVE_BELCARD_H) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 2d911d0ed..989051e89 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -49,6 +49,7 @@ set(LINPHONE_HEADER_FILES sipsetup.h xml2lpc.h xmlrpc.h + vcard.h ) set(LINPHONE_SOURCE_FILES_C @@ -165,6 +166,13 @@ endif() if(INTL_FOUND) list(APPEND LIBS ${INTL_LIBRARIES}) endif() +if(BELCARD_FOUND) + list(APPEND LIBS ${BELCARD_LIBRARIES}) + list(APPEND LINPHONE_SOURCE_FILES_CXX vcard.cc) + add_definitions(-DVCARD_ENABLED) +else() + list(APPEND LINPHONE_SOURCE_FILES_C vcard_stubs.c) +endif() if(ENABLE_STATIC) add_library(linphone STATIC ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX}) diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index 7ed25ecaa..5309cf44f 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -46,6 +46,7 @@ set(SOURCE_FILES tunnel_tester.c upnp_tester.c video_tester.c + vcard_tester.c ) apply_compile_flags(SOURCE_FILES "CPP" "C")