
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)
#add_executable(test_libvlc_meta              libvlc/meta.c
#                                             samples/meta.sample)

target_link_libraries(test_libvlc_core               libvlc)
target_link_libraries(test_libvlc_events             libvlc)
#target_link_libraries(test_libvlc_media_player       libvlc)
target_link_libraries(test_libvlc_media_list         libvlc)
#target_link_libraries(test_libvlc_media_list_player  libvlc)
#target_link_libraries(test_libvlc_meta               libvlc)

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

MACRO(download_sample sample dest)
  add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${dest}
   COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/samples
   COMMAND curl -L ${SAMPLES_SERVER}/${sample} > ${CMAKE_CURRENT_BINARY_DIR}/${dest}
  )
ENDMACRO(download_sample)

#download_sample(avi/Hero-Div3.avi samples/test.sample)
#download_sample(metadata/id3tag/Wesh-Bonneville.mp3 samples/meta.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)
add_test(test_libvlc_meta
    ${CMAKE_CURRENT_BINARY_DIR}/test_libvlc_meta)

