36 lines
1.5 KiB
CMake
36 lines
1.5 KiB
CMake
project(ffConv)
|
|
add_executable(ffConv ffConv.cpp)
|
|
add_dependencies(ffConv ffcpp)
|
|
target_link_libraries(ffConv ffcpp)
|
|
|
|
project(ffPreview)
|
|
add_executable(ffPreview ffPreview.cpp)
|
|
add_dependencies(ffPreview ffcpp)
|
|
target_link_libraries(ffPreview ffcpp)
|
|
|
|
project(ffPlayer)
|
|
|
|
find_package(FFMPEG REQUIRED)
|
|
if(NOT FFMPEG_FOUND)
|
|
message(FATAL_ERROR "FFMpeg not found")
|
|
endif()
|
|
include_directories(${FFMPEG_INCLUDE_DIR})
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
if(NOT SDL2_FOUND)
|
|
message(FATAL_ERROR "SDL2 not found")
|
|
endif()
|
|
include_directories(${SDL2_INCLUDE_DIR})
|
|
|
|
add_executable(ffPlayer ffPlayer.cpp)
|
|
add_dependencies(ffPlayer ffcpp)
|
|
target_link_libraries(ffPlayer ffcpp ${SDL2_LIBRARY})
|
|
|
|
if(WIN32)
|
|
add_custom_command(TARGET ffPlayer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FFMPEG_AVFORMAT_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
add_custom_command(TARGET ffPlayer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FFMPEG_AVCODEC_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
add_custom_command(TARGET ffPlayer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FFMPEG_AVUTIL_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
add_custom_command(TARGET ffPlayer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FFMPEG_SWSCALE_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
add_custom_command(TARGET ffPlayer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FFMPEG_SWRESAMPLE_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
add_custom_command(TARGET ffPlayer POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
endif() |