CMakeLists.txt 657 B

123456789101112131415
  1. include_directories(${CMAKE_SOURCE_DIR})
  2. add_executable(sherpa-ncnn-ffmpeg sherpa-ncnn-ffmpeg.cc)
  3. # Link libraries from sherpa-ncnn.
  4. target_link_libraries(sherpa-ncnn-ffmpeg sherpa-ncnn-c-api)
  5. find_package(PkgConfig REQUIRED)
  6. pkg_check_modules(AVCODEC REQUIRED libavcodec)
  7. include_directories(${AVCODEC_INCLUDE_DIRS})
  8. target_link_directories(sherpa-ncnn-ffmpeg PRIVATE ${AVCODEC_LIBRARY_DIRS})
  9. # All libraries of FFmpeg shares the same include and library directory.
  10. # Note that ${AVCODEC_LIBRARIES} equals to avcodec, but we add it for consistence.
  11. target_link_libraries(sherpa-ncnn-ffmpeg avformat avfilter avcodec avutil swresample swscale avdevice)