File: vtkTestFFMPEG.cmake

package info (click to toggle)
vtk6 6.3.0%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 118,532 kB
  • ctags: 138,251
  • sloc: cpp: 1,443,749; ansic: 113,395; python: 72,383; tcl: 46,998; xml: 8,127; yacc: 4,525; java: 4,239; perl: 3,108; lex: 1,694; sh: 1,093; asm: 471; makefile: 95; objc: 17
file content (63 lines) | stat: -rw-r--r-- 1,887 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
if(FFMPEG_INCLUDE_DIR)
  if(NOT DEFINED VTK_FFMPEG_HAS_OLD_HEADER)
    if(EXISTS ${FFMPEG_INCLUDE_DIR}/ffmpeg)
      set(VTK_FFMPEG_HAS_OLD_HEADER "TRUE" CACHE INTERNAL
        "Is the FFMPEG include in the old location")
    else()
      set(VTK_FFMPEG_HAS_OLD_HEADER "FALSE" CACHE INTERNAL
        "Is the FFMPEG include in the old location")
    endif()
    if(VTK_FFMPEG_HAS_OLD_HEADER)
      message(STATUS "Checking if FFMPEG uses old style header files - yes")
    else()
      message(STATUS "Checking if FFMPEG uses old style header files - no")
    endif()
  endif()

  if(VTK_FFMPEG_HAS_OLD_HEADER)
    set(FFMEG_CODEC_HEADER_PATH "ffmpeg")
    set(FFMEG_FORMAT_HEADER_PATH "ffmpeg")
  else()
    set(FFMEG_CODEC_HEADER_PATH "libavcodec")
    set(FFMEG_FORMAT_HEADER_PATH "libavformat")
  endif()

  include(CheckCSourceCompiles)
  set(CMAKE_REQUIRED_INCLUDES ${FFMPEG_INCLUDE_DIR})
  set(CMAKE_REQUIRED_LIBRARIES ${FFMPEG_avformat_LIBRARY}
    ${FFMPEG_avutil_LIBRARY} ${FFMPEG_avcodec_LIBRARY})

  if(NOT DEFINED VTK_FFMPEG_HAS_IMG_CONVERT AND FFMPEG_avcodec_LIBRARY)
    set(_source "
#include <${FFMEG_CODEC_HEADER_PATH}/avcodec.h>
int main()
{
  img_convert(0, AV_PIX_FMT_RGB24,
              0, AV_PIX_FMT_RGB24,
              0, 0);
  return 0;
}\n")
    check_c_source_compiles("${_source}" VTK_FFMPEG_HAS_IMG_CONVERT)
  endif()

  if(NOT DEFINED VTK_FFMPEG_NEW_ALLOC AND FFMPEG_avformat_LIBRARY)
    set(_source "
#include <${FFMEG_FORMAT_HEADER_PATH}/avformat.h>
int main()
{
  avformat_alloc_context();
  return 0;
}\n")
    check_c_source_compiles("${_source}" VTK_FFMPEG_NEW_ALLOC)
  endif()
  if(NOT DEFINED VTK_FFMPEG_AVCODECID AND FFMPEG_avformat_LIBRARY)
    set(_source "
#include <${FFMEG_FORMAT_HEADER_PATH}/avformat.h>
int main()
{
  enum AVCodecID codec;
  return 0;
}\n")
    check_c_source_compiles("${_source}" VTK_FFMPEG_AVCODECID)
  endif()
endif()