############################################################################
# CMakeLists.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.
#
############################################################################
cmake_minimum_required(VERSION 3.0)
project(oRTP VERSION 0.27.0)
set(ORTP_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
set(ORTP_MINOR_VERSION ${PROJECT_VERSION_MINOR})
set(ORTP_MICRO_VERSION ${PROJECT_VERSION_PATCH})
set(ORTP_VERSION ${PROJECT_VERSION})
set(ORTP_SO_VERSION "12") # incremented on June, the 1st 2016. DO NOT INCREMENT BEFORE ORTP 0.28
option(ENABLE_SHARED "Build shared library." YES)
option(ENABLE_STATIC "Build static library." YES)
option(ENABLE_DOC "Enable documentation generation with Doxygen." YES)
option(ENABLE_NTP_TIMESTAMP "Turn on NTP timestamping on packet reception." NO)
option(ENABLE_PERF "Disable costly features to reduce cpu consumtion and increase performance." NO)
option(ENABLE_STRICT "Build with strict compile options." YES)
option(ENABLE_TESTS "Enable compilation of test programs." NO)
option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
set(WITH_THREAD_STACK_SIZE "0" CACHE STRING "Set thread stack size (0 is the OS default).")
macro(apply_compile_flags SOURCE_FILES)
if(${SOURCE_FILES})
set(options "")
foreach(a ${ARGV})
if(STRICT_OPTIONS_${a})
string(REPLACE ";" " " options_${a} "${STRICT_OPTIONS_${a}}")
set(options "${options} ${options_${a}}")
endif()
endforeach()
if(options)
set_source_files_properties(${${SOURCE_FILES}} PROPERTIES COMPILE_FLAGS "${options}")
endif()
endif()
endmacro()
include(CheckIncludeFile)
include(CheckFunctionExists)
include(GNUInstallDirs)
if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
message(STATUS "Setting install rpath to ${CMAKE_INSTALL_RPATH}")
endif()
set(MSVC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/MSVC")
if(MSVC)
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSVC_INCLUDE_DIR}")
endif()
find_package(Threads)
find_library(LIBM NAMES m)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
else()
find_package(BcToolbox 0.0.3 REQUIRED)
endif()
check_include_file(sys/uio.h HAVE_SYS_UIO_H)
check_include_file(sys/audio.h HAVE_SYS_AUDIO_H)
check_include_file(sys/shm.h HAVE_SYS_SHM_H)
check_function_exists(arc4random HAVE_ARC4RANDOM)
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
if(WORDS_BIGENDIAN)
set(ORTP_BIGENDIAN 1)
endif()
include_directories(
include/
src/
${CMAKE_CURRENT_BINARY_DIR}
${BCTOOLBOX_CORE_INCLUDE_DIRS}
)
if(MSVC)
include_directories(${MSVC_INCLUDE_DIR})
endif()
set(ORTP_CPPFLAGS )
if(ENABLE_STATIC)
set(ORTP_STATIC 1)
list(APPEND ORTP_CPPFLAGS "-DORTP_STATIC")
endif()
if(ENABLE_PERF)
set(PERF 1)
endif()
if(ENABLE_NTP_TIMESTAMP)
set(ORTP_TIMESTAMP 1)
endif()
if(ENABLE_DEBUG_LOGS)
set(ORTP_DEBUG_MODE 1)
endif()
if(CMAKE_USE_PTHREADS_INIT)
set(ORTP_DEFAULT_THREAD_STACK_SIZE ${WITH_THREAD_STACK_SIZE})
endif()
if(APPLE)
set(__APPLE_USE_RFC_3542 1)
endif()
set(POSIXTIMER_INTERVAL 10000)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/ortp-config.h)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/ortp-config.h PROPERTIES GENERATED ON)
add_definitions(-DHAVE_CONFIG_H)
set(STRICT_OPTIONS_CPP )
set(STRICT_OPTIONS_C )
if(MSVC)
if(ENABLE_STRICT)
list(APPEND STRICT_OPTIONS_CPP "/WX")
endif()
else()
list(APPEND STRICT_OPTIONS_CPP "-Wall" "-Wuninitialized")
list(APPEND STRICT_OPTIONS_C "-Wdeclaration-after-statement" "-Wstrict-prototypes" "-Wno-error=strict-prototypes")
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
list(APPEND STRICT_OPTIONS_CPP "-Qunused-arguments" "-Wno-array-bounds")
endif()
if(APPLE)
list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds")
endif()
if(ENABLE_STRICT)
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-fno-strict-aliasing")
endif()
endif()
if(STRICT_OPTIONS_CPP)
list(REMOVE_DUPLICATES STRICT_OPTIONS_CPP)
endif()
if(STRICT_OPTIONS_C)
list(REMOVE_DUPLICATES STRICT_OPTIONS_C)
endif()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
set(EXPORT_TARGETS_NAME "LinphoneBuilder")
else()
set(EXPORT_TARGETS_NAME "ORTP")
endif()
add_subdirectory(include)
add_subdirectory(src)
if(ENABLE_DOC)
find_package(Doxygen)
if(DOXYGEN_FOUND)
set(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/ortp.doxygen)
file(GLOB DOC_INPUT_FILES
include/ortp/[^.]*.h
src/[^.]*.h
src/[^.]*.c
)
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/doc/html/index.html"
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/ortp.doxygen
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ortp.doxygen ${DOC_INPUT_FILES}
)
add_custom_target(ortp-html-doc ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/html/index.html")
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html"
DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/oRTP-${ORTP_VERSION}")
endif()
endif()
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${prefix}/bin)
set(libdir ${prefix}/lib)
set(includedir ${prefix}/include)
set(ORTP_PKGCONFIG_VERSION "${ORTP_VERSION}")
set(ORTPDEPS_LIBS )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ortp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ortp.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake"
VERSION ${ORTP_VERSION}
COMPATIBILITY AnyNewerVersion
)
export(EXPORT ${EXPORT_TARGETS_NAME}Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/ORTPTargets.cmake"
)
configure_file(ORTPConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/ORTPConfig.cmake"
@ONLY
)
set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake")
install(EXPORT ${EXPORT_TARGETS_NAME}Targets
FILE ORTPTargets.cmake
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/ORTPConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ORTPConfigVersion.cmake"
DESTINATION ${CONFIG_PACKAGE_LOCATION}
)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ortp-0.27.0.tar.gz (129个子文件)
configure.ac 11KB
Makefile.am 2KB
Makefile.am 2KB
Makefile.am 708B
Makefile.am 267B
Makefile.am 138B
Makefile.am 47B
Makefile.am 43B
Makefile.am 26B
Makefile.am 13B
AUTHORS 1KB
rtpsession.c 79KB
rtpsession_inet.c 58KB
rtcp.c 26KB
rtcpparse.c 21KB
port.c 21KB
avprofile.c 20KB
b64.c 20KB
netsim.c 16KB
rtcp_fb.c 15KB
telephonyevents.c 13KB
rtcp_xr.c 12KB
rtpparse.c 12KB
logging.c 11KB
str_utils.c 8KB
jitterctl.c 7KB
sessionset.c 7KB
scheduler.c 6KB
rtpprofile.c 6KB
ortp.c 6KB
payloadtype.c 6KB
event.c 5KB
tevmrtprecv.c 5KB
dll_entry.c 4KB
rtprecv.c 4KB
posixtimer.c 4KB
mrtprecv.c 4KB
mrtpsend.c 4KB
rtpmemtest.c 4KB
rtpsend_stupid.c 3KB
utils.c 3KB
rtpsend.c 3KB
tevrtprecv.c 3KB
tevrtpsend.c 3KB
rtpsignaltable.c 2KB
extremum.c 2KB
test_timer.c 1KB
rtptimer.c 1KB
fmtpparse.c 1KB
ChangeLog 5KB
ortp-config.h.cmake 2KB
compile 7KB
configure 457KB
COPYING 26KB
RTPSender.cpp 5KB
RTPReceiver.cpp 5KB
winrttimer.cpp 2KB
depcomp 23KB
ortp.doxygen 103KB
config.guess 42KB
rtpsession.h 31KB
rtcp.h 20KB
b64.h 17KB
port.h 11KB
inttypes.h 8KB
payloadtype.h 8KB
stdint.h 8KB
str_utils.h 6KB
event.h 6KB
rtp.h 5KB
rtpsession_priv.h 5KB
logging.h 4KB
sessionset.h 4KB
rtpprofile.h 4KB
ortp_AndroidConfig.h 4KB
telephonyevents.h 3KB
ortp.h 3KB
utils.h 3KB
scheduler.h 3KB
jitterctl.h 2KB
rtpsignaltable.h 2KB
rtptimer.h 1KB
winrttimer.h 226B
ortp.doxygen.in 103KB
Makefile.in 33KB
Makefile.in 30KB
Makefile.in 29KB
Makefile.in 19KB
Makefile.in 17KB
Makefile.in 13KB
Makefile.in 13KB
Makefile.in 13KB
Makefile.in 12KB
ortp-config.h.in 4KB
ortp.spec.in 3KB
ORTPConfig.cmake.in 2KB
ortp.pc.in 310B
INSTALL 15KB
install-sh 14KB
pkg.list 721B
共 129 条
- 1
- 2
资源评论
Forest
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功