Skip to content

Commit

Permalink
examples: Add CMake build support for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jrsnen committed Aug 25, 2022
1 parent 8502ca6 commit 1f2ef1c
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ if(APPLE)
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Security")
endif()

add_subdirectory(examples EXCLUDE_FROM_ALL)
add_subdirectory(test EXCLUDE_FROM_ALL)

#
Expand Down
148 changes: 148 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
project(uvgrtp_examples)

add_executable(binding)
target_sources(binding
PRIVATE
binding.cc
)
target_link_libraries(binding
PRIVATE
uvgrtp
)

add_executable(configuration)
target_sources(configuration
PRIVATE
configuration.cc
)
target_link_libraries(configuration
PRIVATE
uvgrtp
)

add_executable(custom_timestamps)
target_sources(custom_timestamps
PRIVATE
custom_timestamps.cc
)
target_link_libraries(custom_timestamps
PRIVATE
uvgrtp
)

add_executable(receiving_hook)
target_sources(receiving_hook
PRIVATE
receiving_hook.cc
)
target_link_libraries(receiving_hook
PRIVATE
uvgrtp
)

add_executable(receiving_poll)
target_sources(receiving_poll
PRIVATE
receiving_poll.cc
)
target_link_libraries(receiving_poll
PRIVATE
uvgrtp
)

add_executable(rtcp_hook)
target_sources(rtcp_hook
PRIVATE
rtcp_hook.cc
)
target_link_libraries(rtcp_hook
PRIVATE
uvgrtp
)

add_executable(sending)
target_sources(sending
PRIVATE
sending.cc
)
target_link_libraries(sending
PRIVATE
uvgrtp
)

add_executable(sending_generic)
target_sources(sending_generic
PRIVATE
sending_generic.cc
)
target_link_libraries(sending_generic
PRIVATE
uvgrtp
)


# SRTP user keys example
add_executable(srtp_user)
target_sources(srtp_user
PRIVATE
srtp_user.cc
)

if(MSVC)
target_link_libraries(srtp_user
PRIVATE
uvgrtp
cryptlib
)
else()
target_link_libraries(srtp_user
PRIVATE
uvgrtp
cryptopp
)
endif()


# SRTP + ZRTP example
add_executable(srtp_zrtp)
target_sources(srtp_zrtp
PRIVATE
srtp_zrtp.cc
)

if(MSVC)
target_link_libraries(srtp_zrtp
PRIVATE
uvgrtp
cryptlib
)
else()
target_link_libraries(srtp_zrtp
PRIVATE
uvgrtp
cryptopp
)
endif()



# ZRTP Multistream example
add_executable(zrtp_multistream)
target_sources(zrtp_multistream
PRIVATE
zrtp_multistream.cc
)

if(MSVC)
target_link_libraries(zrtp_multistream
PRIVATE
uvgrtp
cryptlib
)
else()
target_link_libraries(zrtp_multistream
PRIVATE
uvgrtp
cryptopp
)
endif()

0 comments on commit 1f2ef1c

Please sign in to comment.