简体   繁体   English

如何在CMake中使用PJSIP库?

[英]How to use PJSIP library with CMake?

I know how the basic Makefile for a simple project using pjsip library looks like . 我知道基本的如何Makefile使用一个简单的项目pjsip的样子 But what does the equivalent CMake file look like? 但等效的CMake文件是什么样的?

project(myapp)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)

include (FindPkgConfig)
if (PKG_CONFIG_FOUND) # true if pkg-config works on the system
  pkg_check_modules(PJSIP REQUIRED libpjproject)
endif()

include_directories(${PJSIP_INCLUDE_DIRS})
link_directories(${PJSIP_LIBRARY_DIRS})

add_executable(${PROJECT_NAME} ${SRC_LIST})

target_link_libraries(${PROJECT_NAME} ${PJSIP_LIBRARIES})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM