Question

Has someone compiled pjsip using cmake?

Was it helpful?

Solution

The project does not have a way of using CMake to build the library itself (yet). But you can link to pjproject libs from your CMake project. Here's a snippet from one of mine that uses pjproject as a dependency:

find_package(PKGCONFIG REQUIRED)
pkg_check_modules(PJSIP libpjproject>=1.14 REQUIRED)
include_directories(${PJSIP_INCLUDE_DIRS})
...
target_link_libraries(your_target ${PJSIP_LIBRARIES})

This requires pkg-config as well, and that pjproject.pc should be in it's default search path, or in directory in $PKG_CONFIG_PATH.

This should work on Linux and OS X.

OTHER TIPS

I just made cmake-based compilation of PJSIP v2.3. I use this compilation only on Windows platform for now, not tested on linux.

On Linux I recommend use PKG_CONFIG tool to discover PJSIP for your app.

Having peeked at their repository, the project is auto-tools/configure based. You would need to port the build system yourself. Depending on complexity, it is not that hard to accomplish. I have converted many projects to cmake. Maybe the pjsip comunity would welcome an upgrade to their build system, as I see they support multiple platforms like iphone, and windows through visual studio.

If you are using Clion IDE then it can automatically generate cmake file for pjproject. Just import it and it will open a wizard. You’ll need to specify the location of the sources, then select project files and include directories. Clion has the ability to make the cmake file from existing projects. for more help please see this link Clion Documentation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top