Closed zombiecong closed 7 years ago
Hello,
Sure, you have to download a release: https://github.com/aisouard/libwebrtc/releases/tag/v1.0.0
Extract the include
and lib
folders inside the /usr/local
directory.
Then use this CMakeLists.txt, depending on your platform, assuming you're using Linux:
cmake_minimum_required(VERSION 3.3)
project(sample)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(X11 REQUIRED)
list(APPEND LIBWEBRTC_LIBRARIES webrtc ${X11_LIBRARIES} ${CMAKE_DL_LIBS} rt Threads::Threads)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -pthread")
add_definitions(-DWEBRTC_POSIX -D_GLIBCXX_USE_CXX11_ABI=0)
set(SOURCE_FILES main.cpp)
add_executable(sample ${SOURCE_FILES})
target_link_libraries(sample ${LIBWEBRTC_LIBRARIES})
I might add an option to specify an existing library and include directory.
thanks for your reply, how about using it in windows?
Sorry for the delay, I don't have the settings in my mind right now.
cmake_minimum_required(VERSION 3.3)
project(sample)
list(APPEND LIBWEBRTC_LIBRARIES webrtc.lib msdmo.lib wmcodecdspuuid.lib dmoguids.lib
crypt32.lib iphlpapi.lib ole32.lib secur32.lib winmm.lib ws2_32.lib)
# Set to /MTd in debug
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
add_definitions(WEBRTC_WIN NOMINMAX _CRT_SECURE_NO_WARNINGS)
set(SOURCE_FILES main.cpp)
add_executable(sample ${SOURCE_FILES})
target_link_libraries(sample ${LIBWEBRTC_LIBRARIES})
@aisouard Thank you very much. I will test it next week.
Hi, can i run the sample by the release library without building all the webrtc source? I find you open a issue #6 .