include(@CMAKE_HELP_DIR@/functions.cmake)

dynamic_lib_file_ending(DYNAMIC_LIB_FILE_ENDING)

# Remove all libs
file(GLOB CURRENT_FILES @RUNTIME_CONTEXT@/*.${DYNAMIC_LIB_FILE_ENDING})
list(REMOVE_ITEM CURRENT_FILES "app_common_video.${DYNAMIC_LIB_FILE_ENDING}")

if (CURRENT_FILES)
    file(REMOVE ${CURRENT_FILES})
endif ()

# Copy fltk libs
file(GLOB LIBRARY_FILES @FLTK_BIN_DIR@/*.${DYNAMIC_LIB_FILE_ENDING})
file(COPY ${LIBRARY_FILES} DESTINATION @RUNTIME_CONTEXT@)

# Copy tello libs
file(GLOB LIBRARY_FILES @TELLO_BIN_DIR@/*.${DYNAMIC_LIB_FILE_ENDING})
file(COPY ${LIBRARY_FILES} DESTINATION @RUNTIME_CONTEXT@)

# Copy ffmpeg libs
file(GLOB LIBRARY_FILES @FFMPEG_BIN_DIR@/*.${DYNAMIC_LIB_FILE_ENDING})
file(COPY ${LIBRARY_FILES} DESTINATION @RUNTIME_CONTEXT@)

# Copy opencv libs
file(GLOB LIBRARY_FILES @OPENCV_BIN_DIR@/*.${DYNAMIC_LIB_FILE_ENDING})
file(COPY ${LIBRARY_FILES} DESTINATION @RUNTIME_CONTEXT@)