如何使用PJSIP库与CMake? [英] How to use PJSIP library with CMake?
本文介绍了如何使用PJSIP库与CMake?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道如何基本的 Makefile
一个简单的项目使用 pjsip
library 看起来像。但是,等价的 CMake
文件是什么样子的?
I know how the basic Makefile
for a simple project using pjsip
library looks like. But what does the equivalent CMake
file look like?
推荐答案
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})
这篇关于如何使用PJSIP库与CMake?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文