CMakeLists.txt 720 B

12345678910111213141516
  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. target_link_libraries(sherpa-ncnn-ffmpeg ${AVCODEC_LIBRARIES})
  10. # All libraries of FFmpeg shares the same include and library directory.
  11. # Note that ${AVCODEC_LIBRARIES} equals to avcodec, but we add it for consistence.
  12. target_link_libraries(sherpa-ncnn-ffmpeg avcodec avformat avfilter avutil swresample swscale avdevice)