diff options
Diffstat (limited to 'indra/cmake/WebRTC.cmake')
-rw-r--r-- | indra/cmake/WebRTC.cmake | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake new file mode 100644 index 0000000000..f8ce9c8104 --- /dev/null +++ b/indra/cmake/WebRTC.cmake @@ -0,0 +1,43 @@ +# -*- cmake -*- +include(CMakeCopyIfDifferent) + +include(Linking) + +include_guard() + +set(WEBRTC_ROOT ${CMAKE_BINARY_DIR}/../../webrtc/src) +file(COPY ${WEBRTC_ROOT}/out/Default/obj/webrtc.lib + DESTINATION ${CMAKE_BINARY_DIR}/packages/lib/release +) +set(WEBRTC_INCLUDE_DIR ${CMAKE_BINARY_DIR}/packages/include/webrtc) +file(MAKE_DIRECTORY ${WEBRTC_INCLUDE_DIR}) + +file(COPY ${WEBRTC_ROOT}/api + ${WEBRTC_ROOT}/media/base + ${WEBRTC_ROOT}/media/engine + ${WEBRTC_ROOT}/rtc_base + ${WEBRTC_ROOT}/pc + ${WEBRTC_ROOT}/p2p + ${WEBRTC_ROOT}/call + ${WEBRTC_ROOT}/media + ${WEBRTC_ROOT}/system_wrappers + ${WEBRTC_ROOT}/common_video + ${WEBRTC_ROOT}/video + ${WEBRTC_ROOT}/common_audio + ${WEBRTC_ROOT}/logging + ${WEBRTC_ROOT}/third_party/abseil-cpp/absl + DESTINATION ${WEBRTC_INCLUDE_DIR} + FILES_MATCHING PATTERN "*.h" +) + +add_library(ll::webrtc STATIC IMPORTED) + +if (LINUX) + target_link_libraries( ll::webrtc INTERFACE ../webrtc/src/obj/Default/webrtc) +elseif (DARWIN) + target_link_libraries( ll::webrtc INTERFACE ../webrtc/src/obj/Default/webrtc) +elseif (WINDOWS) + set_target_properties( ll::webrtc PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/packages/lib/release/webrtc.lib) + target_link_libraries( ll::webrtc INTERFACE ${CMAKE_BINARY_DIR}/packages/lib/release/webrtc.lib) +endif (LINUX) +target_include_directories( ll::webrtc INTERFACE "${WEBRTC_INCLUDE_DIR}") |