sourcey / libsourcey

C++14 evented IO libraries for high performance networking and media based applications
https://sourcey.com/libsourcey
GNU Lesser General Public License v2.1
1.31k stars 347 forks source link

webrtc library path in cmake always reset to not found #115

Closed webbery closed 7 years ago

webbery commented 7 years ago

hello, I set 'WEBRTC_INCLUDE_DIR=E:/WebRTC-Win/webrtc/src' in cmake gui. Then click 'Configure' button and find the output is

Could NOT find WEBRTC (missing:  WEBRTC_LIBRARY)
Failed to include dependency: WebRTC. Please build and install dependencies before using CMake.

So I manually select webrtc.lib which in E:/WebRTC-Win/webrtc/src/out/Debug/obj/webrtc/ to 'WEBRTC_LIBRARY_DEBUG'. But if I click 'Configure' button this paramater will be reset to 'WEBRTC_LIBRARY_DEBUG-NOTFOUND'. I read the cmake file and find 'PATHS_DEBUG ${WEBRTC_INCLUDE_DIR}/${_WEBRTC_SUFFIX_DEBUG}'. So I copy webrtc.lib from above path to E:/WebRTC-Win/webrtc/srcout/Debug and set 'WEBRTC_LIBRARY_DEBUG' again. But after configure it always reset 'WEBRTC_LIBRARY_DEBUG' to 'NOTFOUND'. Did I do something wrong?

auscaster commented 7 years ago

Hi there, I'll try to take a look over the next couple of days on my windows machine. In the mean time if you make any progress please let me know, or post a PR

groundflyer commented 7 years ago

Have the same problem on centos. I have built webrtc (using chromium instructions), but cmake can't find the *.a libraries when I specify them. Maybe I need to build shared libraries?

auscaster commented 7 years ago

Hi there!

WEBRTC_INCLUDE_DIR has changed to WEBRTC_ROOT_DIR now, maybe that will solve the issue for you?

.a libraries should work just fine, alternatively build your WebRTC lib with https://github.com/sourcey/webrtcbuilds

groundflyer commented 7 years ago

I can't use webrtcbuilds, as it works only on debian-based distros.

I set WEBRTC_ROOT_DIR to webrtc-checkout/src, where the build dirs out/Release and out/Debug are, and suffixes respectively. They content obj/webrtc/libwebrtc_common.a and obj/webrtc/libwebrtc.a. I tried to specify both, but still getting the error:

CMake Error at cmake/LibSourceyIncludes.cmake:66 (message):
  Failed to include dependency: WebRTC.  Please build and install
  dependencies before using CMake.
Call Stack (most recent call first):
  LibSourcey.cmake:252 (find_dependency)
  CMakeLists.txt:29 (include)
auscaster commented 7 years ago

Sorry for the trouble, that all sounds correct. Let me try it out on my Ubuntu box and get back to you.

auscaster commented 7 years ago

Turns out cmake get_file_component works different on Windows and Linux. On Linux it was trimming the final directory!

It should be working now.

groundflyer commented 7 years ago

Thanks. It's working.