How to use PJSIP library with CMake?

吃可爱长大的小学妹 提交于 2019-12-13 04:13:27

问题


I know how the basic Makefile for a simple project using pjsip library looks like. But what does the equivalent CMake file look like?


回答1:


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


来源:https://stackoverflow.com/questions/18827168/how-to-use-pjsip-library-with-cmake

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!