Commit 60cab722 authored by Frédéric Boiteux's avatar Frédéric Boiteux Committed by Gautier Pelloux-Prayer

Allow compilation of test programs

Add CMake instructions to build and install test binaries, and
compile them with strict options as oRTP library's sources.
parent 8440432f
...@@ -120,5 +120,5 @@ if(ENABLE_SHARED) ...@@ -120,5 +120,5 @@ if(ENABLE_SHARED)
endif() endif()
if(ENABLE_TESTS) if(ENABLE_TESTS)
#add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
...@@ -21,33 +21,46 @@ ...@@ -21,33 +21,46 @@
############################################################################ ############################################################################
set(RTPSEND_SOURCES rtpsend.c) set(RTPSEND_SOURCES rtpsend.c)
apply_compile_flags(RTPSEND_SOURCES "CPP" "C")
add_executable(rtpsend ${RTPSEND_SOURCES}) add_executable(rtpsend ${RTPSEND_SOURCES})
target_link_libraries(rtpsend ortp) target_link_libraries(rtpsend ortp)
set(RTPRECV_SOURCES rtprecv.c) set(RTPRECV_SOURCES rtprecv.c)
apply_compile_flags(RTPRECV_SOURCES "CPP" "C")
add_executable(rtprecv ${RTPRECV_SOURCES}) add_executable(rtprecv ${RTPRECV_SOURCES})
target_link_libraries(rtprecv ortp) target_link_libraries(rtprecv ortp)
set(MRTPSEND_SOURCES mrtpsend.c) set(MRTPSEND_SOURCES mrtpsend.c)
apply_compile_flags(MRTPSEND_SOURCES "CPP" "C")
add_executable(mrtpsend ${MRTPSEND_SOURCES}) add_executable(mrtpsend ${MRTPSEND_SOURCES})
target_link_libraries(mrtpsend ortp) target_link_libraries(mrtpsend ortp)
set(MRTPRECV_SOURCES mrtprecv.c) set(MRTPRECV_SOURCES mrtprecv.c)
apply_compile_flags(MRTPRECV_SOURCES "CPP" "C")
add_executable(mrtprecv ${RTPRECV_SOURCES}) add_executable(mrtprecv ${RTPRECV_SOURCES})
target_link_libraries(mrtprecv ortp) target_link_libraries(mrtprecv ortp)
set(TEST_TIMER_SOURCES test_timer.c) set(TEST_TIMER_SOURCES test_timer.c)
apply_compile_flags(TEST_TIMER_SOURCES "CPP" "C")
add_executable(test_timer ${TEST_TIMER_SOURCES}) add_executable(test_timer ${TEST_TIMER_SOURCES})
target_link_libraries(test_timer ortp) target_link_libraries(test_timer ortp)
set(TEVRTPSEND_SOURCES tevrtpsend.c) set(TEVRTPSEND_SOURCES tevrtpsend.c)
apply_compile_flags(TEVRTPSEND_SOURCES "CPP" "C")
add_executable(tevrtpsend ${TEVRTPSEND_SOURCES}) add_executable(tevrtpsend ${TEVRTPSEND_SOURCES})
target_link_libraries(tevrtpsend ortp) target_link_libraries(tevrtpsend ortp)
set(TEVRTPRECV_SOURCES tevrtprecv.c) set(TEVRTPRECV_SOURCES tevrtprecv.c)
apply_compile_flags(TEVRTPRECV_SOURCES "CPP" "C")
add_executable(tevrtprecv ${TEVRTPRECV_SOURCES}) add_executable(tevrtprecv ${TEVRTPRECV_SOURCES})
target_link_libraries(tevrtprecv ortp) target_link_libraries(tevrtprecv ortp)
set(RTPSEND_STUPID_SOURCES rtpsend_stupid.c) set(RTPSEND_STUPID_SOURCES rtpsend_stupid.c)
apply_compile_flags(RTPSEND_STUPID_SOURCES "CPP" "C")
add_executable(rtpsend_stupid ${RTPSEND_STUPID_SOURCES}) add_executable(rtpsend_stupid ${RTPSEND_STUPID_SOURCES})
target_link_libraries(rtpsend_stupid ortp) target_link_libraries(rtpsend_stupid ortp)
install(TARGETS rtpsend rtprecv mrtpsend mrtprecv test_timer tevrtpsend tevrtprecv rtpsend_stupid
RUNTIME DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment