CMakeLists.txt 1.74 KB
Newer Older
moto's avatar
moto committed
1
2
3
4
set(
  sources
  ffmpeg.cpp
  filter_graph.cpp
moto's avatar
moto committed
5
  hw_context.cpp
moto's avatar
moto committed
6
7
  stream_reader/buffer/chunked_buffer.cpp
  stream_reader/buffer/unchunked_buffer.cpp
8
  stream_reader/conversion.cpp
9
  stream_reader/packet_buffer.cpp
10
  stream_reader/post_process.cpp
moto's avatar
moto committed
11
12
  stream_reader/stream_processor.cpp
  stream_reader/stream_reader.cpp
Moto Hira's avatar
Moto Hira committed
13
  stream_writer/encode_process.cpp
14
  stream_writer/encoder.cpp
15
  stream_writer/packet_writer.cpp
moto's avatar
moto committed
16
  stream_writer/stream_writer.cpp
Moto Hira's avatar
Moto Hira committed
17
  stream_writer/tensor_converter.cpp
moto's avatar
moto committed
18
19
  )

20
21
22
23
24
set(
  ext_sources
  pybind/pybind.cpp
  )

moto's avatar
moto committed
25
26
27
28
29
30
if (USE_CUDA)
  set(
    additional_lib
    cuda_deps)
endif()

31
if (TARGET ffmpeg)
moto-meta's avatar
moto-meta committed
32
33
  torio_library(
    libtorio_ffmpeg
34
35
36
37
    "${sources}"
    ""
    "torch;ffmpeg;${additional_lib}"
    ""
38
    )
moto-meta's avatar
moto-meta committed
39
40
41
  if (BUILD_TORIO_PYTHON_EXTENSION)
    torio_extension(
      _torio_ffmpeg
42
43
      "${ext_sources}"
      ""
moto-meta's avatar
moto-meta committed
44
45
      "libtorio_ffmpeg"
      "TORIO_FFMPEG_EXT_NAME=_torio_ffmpeg"
46
47
48
      )
  endif()
else()
moto-meta's avatar
moto-meta committed
49
50
  torio_library(
    libtorio_ffmpeg4
51
    "${sources}"
moto's avatar
moto committed
52
    ""
53
    "torch;ffmpeg4;${additional_lib}"
54
    ""
moto's avatar
moto committed
55
    )
moto-meta's avatar
moto-meta committed
56
57
  torio_library(
    libtorio_ffmpeg5
58
59
60
61
62
    "${sources}"
    ""
    "torch;ffmpeg5;${additional_lib}"
    ""
    )
moto-meta's avatar
moto-meta committed
63
64
  torio_library(
    libtorio_ffmpeg6
65
66
67
68
69
    "${sources}"
    ""
    "torch;ffmpeg6;${additional_lib}"
    ""
    )
moto-meta's avatar
moto-meta committed
70
71
72
  if (BUILD_TORIO_PYTHON_EXTENSION)
    torio_extension(
      _torio_ffmpeg4
73
74
      "${ext_sources}"
      ""
moto-meta's avatar
moto-meta committed
75
76
      "libtorio_ffmpeg4"
      "TORIO_FFMPEG_EXT_NAME=_torio_ffmpeg4"
77
      )
moto-meta's avatar
moto-meta committed
78
79
    torio_extension(
      _torio_ffmpeg5
80
81
      "${ext_sources}"
      ""
moto-meta's avatar
moto-meta committed
82
83
      "libtorio_ffmpeg5"
      "TORIO_FFMPEG_EXT_NAME=_torio_ffmpeg5"
84
      )
moto-meta's avatar
moto-meta committed
85
86
    torio_extension(
      _torio_ffmpeg6
87
88
      "${ext_sources}"
      ""
moto-meta's avatar
moto-meta committed
89
90
      "libtorio_ffmpeg6"
      "TORIO_FFMPEG_EXT_NAME=_torio_ffmpeg6"
91
92
93
      )
  endif ()
endif()