2010-05-12 01:44:00 +08:00
|
|
|
project(opencv_ffmpeg)
|
|
|
|
|
|
|
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
2010-08-06 01:24:41 +08:00
|
|
|
include_directories(
|
|
|
|
"${CMAKE_SOURCE_DIR}/3rdparty/include"
|
|
|
|
"${CMAKE_SOURCE_DIR}/3rdparty/include/ffmpeg_"
|
|
|
|
)
|
2010-05-12 01:44:00 +08:00
|
|
|
include_directories(
|
|
|
|
"${CMAKE_SOURCE_DIR}/modules/highgui/src"
|
|
|
|
"${CMAKE_SOURCE_DIR}/modules/core/include"
|
|
|
|
"${CMAKE_SOURCE_DIR}/modules/imgproc/include"
|
|
|
|
"${CMAKE_SOURCE_DIR}/modules/highgui/include"
|
|
|
|
)
|
|
|
|
link_directories("${CMAKE_SOURCE_DIR}/3rdparty/lib")
|
|
|
|
|
|
|
|
set(the_target opencv_ffmpeg)
|
|
|
|
add_library(${the_target} ffopencv.cpp ffopencv.h)
|
|
|
|
|
|
|
|
add_dependencies(${the_target} opencv_core)
|
|
|
|
target_link_libraries(${the_target} opencv_core)
|
|
|
|
|
|
|
|
if (NOT MSVC)
|
2010-08-06 01:24:41 +08:00
|
|
|
#target_link_libraries(${the_target}
|
|
|
|
# ${CMAKE_SOURCE_DIR}/3rdparty/lib/libgcc_.a
|
|
|
|
# ${CMAKE_SOURCE_DIR}/3rdparty/lib/libmingwex_.a)
|
2010-05-12 01:44:00 +08:00
|
|
|
if(WIN32 AND MINGW64)
|
|
|
|
target_link_libraries(${the_target} ${CMAKE_SOURCE_DIR}/3rdparty/lib/libavformat64.a
|
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/lib/libavcodec64.a
|
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/lib/libavutil64.a
|
2010-08-06 01:24:41 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/lib/libswscale64.a
|
2010-05-12 01:44:00 +08:00
|
|
|
libws2_32.a)
|
|
|
|
else()
|
|
|
|
target_link_libraries(${the_target} ${CMAKE_SOURCE_DIR}/3rdparty/lib/libavformat.a
|
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/lib/libavcodec.a
|
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/lib/libavutil.a
|
2010-08-06 01:24:41 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/lib/libswscale.a
|
2010-05-12 01:44:00 +08:00
|
|
|
${CMAKE_SOURCE_DIR}/3rdparty/lib/libwsock32_.a)
|
|
|
|
endif()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
set_target_properties(${the_target} PROPERTIES
|
|
|
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
|
|
|
VERSION ${OPENCV_VERSION}
|
|
|
|
OUTPUT_NAME "${the_target}${OPENCV_DLLVERSION}"
|
|
|
|
DEFINE_SYMBOL "CVAPI_EXPORTS"
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
|
|
|
|
)
|
2011-05-11 21:37:20 +08:00
|
|
|
|
2011-05-17 17:40:06 +08:00
|
|
|
if(ENABLE_SOLUTION_FOLDERS)
|
2011-05-11 21:37:20 +08:00
|
|
|
set_target_properties(${the_target} PROPERTIES FOLDER "modules")
|
|
|
|
endif()
|
2010-05-12 01:44:00 +08:00
|
|
|
|
2011-05-02 01:09:40 +08:00
|
|
|
if (MSVC)
|
|
|
|
set_target_properties(${the_target} PROPERTIES
|
|
|
|
LINK_FLAGS "/NODEFAULTLIB:libc /DEBUG"
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
2010-05-12 01:44:00 +08:00
|
|
|
install(TARGETS ${the_target}
|
|
|
|
RUNTIME DESTINATION bin COMPONENT main
|
|
|
|
ARCHIVE DESTINATION lib COMPONENT main
|
|
|
|
LIBRARY DESTINATION lib COMPONENT main
|
|
|
|
)
|