mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 05:38:14 +00:00
Add CMake script to find linphone library.
This commit is contained in:
parent
a75b2d306a
commit
16fa9f8693
2 changed files with 75 additions and 0 deletions
|
|
@ -90,3 +90,9 @@ add_definitions(-DHAVE_CONFIG_H)
|
|||
|
||||
add_subdirectory(coreapi)
|
||||
add_subdirectory(share)
|
||||
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/FindLinphone.cmake
|
||||
DESTINATION share/cmake/Modules
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
|
|
|
|||
69
FindLinphone.cmake
Normal file
69
FindLinphone.cmake
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
############################################################################
|
||||
# FindLinphone.txt
|
||||
# Copyright (C) 2014 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 linphone include file and library
|
||||
#
|
||||
# LINPHONE_FOUND - system has linphone
|
||||
# LINPHONE_INCLUDE_DIRS - the linphone include directory
|
||||
# LINPHONE_LIBRARIES - The libraries needed to use linphone
|
||||
# LINPHONE_CPPFLAGS - The compilation flags needed to use linphone
|
||||
|
||||
find_package(ORTP REQUIRED)
|
||||
find_package(MS2 REQUIRED)
|
||||
find_package(XML2 REQUIRED)
|
||||
find_package(BelleSIP REQUIRED)
|
||||
|
||||
set(_LINPHONEROOT_PATHS
|
||||
${WITH_LINPHONE}
|
||||
${CMAKE_INSTALL_PREFIX}
|
||||
)
|
||||
|
||||
find_path(LINPHONE_INCLUDE_DIRS
|
||||
NAMES linphone/linphonecore.h
|
||||
HINTS _LINPHONE_ROOT_PATHS
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
|
||||
if(LINPHONE_INCLUDE_DIRS)
|
||||
set(HAVE_LINPHONE_LINPHONECORE_H 1)
|
||||
endif()
|
||||
|
||||
find_library(LINPHONE_LIBRARIES
|
||||
NAMES linphone
|
||||
HINTS ${_LINPHONE_ROOT_PATHS}
|
||||
PATH_SUFFIXES bin lib
|
||||
)
|
||||
|
||||
list(APPEND LINPHONE_INCLUDE_DIRS ${ORTP_INCLUDE_DIRS} ${MS2_INCLUDE_DIRS} ${XML2_INCLUDE_DIRS} ${BELLESIP_INCLUDE_DIRS})
|
||||
list(APPEND LINPHONE_LIBRARIES ${ORTP_LIBRARIES} ${MS2_LIBRARIES} ${XML2_LIBRARIES} ${BELLESIP_LIBRARIES})
|
||||
|
||||
list(REMOVE_DUPLICATES LINPHONE_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES LINPHONE_LIBRARIES)
|
||||
set(LINPHONE_CPPFLAGS ${MS2_CPPFLAGS})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Linphone
|
||||
DEFAULT_MSG
|
||||
LINPHONE_INCLUDE_DIRS LINPHONE_LIBRARIES LINPHONE_CPPFLAGS
|
||||
)
|
||||
|
||||
mark_as_advanced(LINPHONE_INCLUDE_DIRS LINPHONE_LIBRARIES LINPHONE_CPPFLAGS)
|
||||
Loading…
Add table
Reference in a new issue