aisouard / libwebrtc

:package: Google's WebRTC implementation in a single static library.
https://axel.isouard.fr/libwebrtc
Apache License 2.0
641 stars 190 forks source link

Using libwebrtc as part of the project without having to 'make install' #81

Closed qknight closed 4 years ago

qknight commented 4 years ago

I would like to include this library like this:

add_subdirectory(third-party/libwebrtc)
include_directories(third-party/libwebrtc)
target_link_libraries(${PROJECT_NAME} libwebrtc)

But the project concept is to use an intermediate step as in 'make; make install'. Is this hard to support?

agouaillard commented 4 years ago

3 ways:

The 2nd way is the most usual and works with precompiled packages as well.

What you are trying to do is the 1st way but I don t think this code support this. https://cmake.org/cmake/help/v3.12/command/export.html

Conan Is more advanced, and this project does not use it.

Sent from my iPhone

On 2 Apr 2020, at 21:33, Joachim Schiele notifications@github.com wrote:

 I would like to include this library like this:

add_subdirectory(third-party/libwebrtc) include_directories(third-party/libwebrtc) target_link_libraries(${PROJECT_NAME} libwebrtc) But the project concept is to use an intermediate step as in 'make; make install'. Is this hard to support?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

qknight commented 4 years ago

Since libwebrtc has such a huge build-time it makes sense to have it as a separate project. ATM I reference it as:

include_directories(
  /sources/third-party/libwebrtc/build/include/webrtc
  /sources/third-party/libwebrtc/build/include/webrtc/third_party/libyuv/include/
  /sources/third-party/libwebrtc/build/webrtc/src/third_party/abseil-cpp
)
add_library(libwebrtc STATIC IMPORTED)
set_property(TARGET libwebrtc PROPERTY IMPORTED_LOCATION "/sources/third-party/libwebrtc/build/lib/libwebrtc.a")
target_link_libraries(${PROJECT_NAME} libwebrtc)

And later I plan to create a runner which will trigger the libwebrtc build from my project each time I do a 'make'.

Thanks!