cmake_minimum_required(VERSION 3.1.0)
project (vastai_samples)

set(SRC_DIR ./)
set(BIN_DIR ./)

set(FFMPEG_INSTALL_DIR $ENV{VASTAI_STREAM_INSTALL})

set(EXECUTABLE_OUTPUT_PATH ${BIN_DIR})
include_directories(${FFMPEG_INSTALL_DIR}/include/ ${FFMPEG_INSTALL_DIR}/ffmpeg/include/ ${SRC_DIR}/common)

link_directories(${FFMPEG_INSTALL_DIR}/lib ${FFMPEG_INSTALL_DIR}/ffmpeg/lib)

# Find all *.c files and store in list NATIVE_SRCS
file(GLOB_RECURSE NATIVE_SRCS RELATIVE ${SRC_DIR} ${SRC_DIR}/*.c)
foreach(SRC_FILE IN LISTS NATIVE_SRCS)
    # Get file name without directory
    get_filename_component(ELFNAME ${SRC_FILE} NAME_WE)

    add_executable(${ELFNAME} ${SRC_DIR}/${SRC_FILE})
    target_link_libraries(${ELFNAME} avutil avformat avcodec avfilter swscale postproc swresample pthread $ENV{PTHREAD_SET} dl)

endforeach()

# 以下android暂不支持
if( $ENV{TARGETOS} MATCHES "linux")

endif()
