Updated CMake files for belcard and belr

This commit is contained in:
Sylvain Berfini 2015-12-21 14:45:59 +01:00
parent 7e6c19510c
commit 9001f40f1a
4 changed files with 75 additions and 0 deletions

View file

@ -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)

55
cmake/FindBelcard.cmake Normal file
View file

@ -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)

View file

@ -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})

View file

@ -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")