
add_executable(test_libvlc_core              libvlc/core.c)
add_executable(test_libvlc_events            libvlc/events.c)
add_executable(test_libvlc_media_player      libvlc/media_player.c
                                             samples/test.sample)
add_executable(test_libvlc_media_list        libvlc/media_list.c)
add_executable(test_libvlc_media_list_player libvlc/media_list_player.c
                                             samples/test.sample)

target_link_libraries(test_libvlc_core               libvlc-control)
target_link_libraries(test_libvlc_events             libvlc-control)
target_link_libraries(test_libvlc_media_player       libvlc-control)
target_link_libraries(test_libvlc_media_list         libvlc-control)
target_link_libraries(test_libvlc_media_list_player  libvlc-control)

set(SAMPLES_SERVER http://streams.videolan.org/streams-videolan/reference)

add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/samples/test.sample
   COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/samples
   COMMAND curl -L ${SAMPLES_SERVER}/avi/Hero-Div3.avi > ${CMAKE_CURRENT_BINARY_DIR}/samples/test.sample
)

add_test(test_libvlc_core
    ${CMAKE_CURRENT_BINARY_DIR}/test_libvlc_core)
add_test(test_libvlc_events
    ${CMAKE_CURRENT_BINARY_DIR}/test_libvlc_events)
add_test(test_libvlc_media_player
    ${CMAKE_CURRENT_BINARY_DIR}/test_libvlc_media_player)
add_test(test_libvlc_media_list
    ${CMAKE_CURRENT_BINARY_DIR}/test_libvlc_media_list)
add_test(test_libvlc_media_list_player
    ${CMAKE_CURRENT_BINARY_DIR}/test_libvlc_media_list_player)

