-
Notifications
You must be signed in to change notification settings - Fork 19
/
CMakeLists.txt
94 lines (79 loc) · 2.61 KB
/
CMakeLists.txt
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
add_library(mxfreader
mxf_essence_helper.c
mxf_index_helper.c
mxf_op1a_reader.c
mxf_opatom_reader.c
mxf_reader.c
)
set(mxfreader_headers
mxf_reader.h
)
target_include_directories(mxfreader PRIVATE
${PROJECT_BINARY_DIR}
)
target_compile_definitions(mxfreader PRIVATE
HAVE_CONFIG_H=1
)
target_link_libraries(mxfreader PUBLIC
MXF
)
set_target_properties(mxfreader PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)
include("${PROJECT_SOURCE_DIR}/cmake/source_filename.cmake")
set_source_filename(mxfreader "${CMAKE_CURRENT_LIST_DIR}" "libMXF")
install(TARGETS mxfreader
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(FILES ${mxfreader_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mxf/examples/reader)
if(LIBMXF_BUILD_TESTING AND (NOT DEFINED BUILD_TESTING OR BUILD_TESTING))
add_executable(test_mxf_reader
test_mxf_reader.c
)
target_link_libraries(test_mxf_reader
mxfreader
MXF
)
include("${PROJECT_SOURCE_DIR}/cmake/source_filename.cmake")
set_source_filename(test_mxf_reader "${CMAKE_CURRENT_LIST_DIR}" "libMXF")
if(LIBMXF_TEST_WITH_VALGRIND)
set(command_prefix valgrind --leak-check=full -q --error-exitcode=1)
else()
set(command_prefix)
endif()
set(tests_25
IMX30 IMX40 IMX50
DNxHD1080p1237 DNxHD1080p1238
DNxHD1080i1242 DNxHD1080i1243
DNxHD720p1251 DNxHD720p1252
DNxHD1080p1253
unc unc1080i unc720p
)
# Not supported: DNxHD1080i1241, DNxHD1080p1235, DNxHD720p1250
foreach(test ${tests_25})
set(test_file "../writeavidmxf/test_${test}_v1.mxf")
add_test(NAME libMXF_reader_${test}
COMMAND ${command_prefix} $<TARGET_FILE:test_mxf_reader> ${test_file} test.dat
)
# Requires output of tests in ../writeavidmxf
set_tests_properties(libMXF_reader_${test} PROPERTIES
FIXTURES_REQUIRED writeavidmxf_samples
)
endforeach()
set(tests_film23.976
DNxHD1080p1253 DNxHD1080p1237 DNxHD1080p1238
)
# Not supported: DNxHD1080p1235
foreach(test ${tests_film23.976})
set(test_file "../writeavidmxf/test_${test}_film23.976_v1.mxf")
add_test(NAME libMXF_reader_${test}_film23.976
COMMAND ${command_prefix} $<TARGET_FILE:test_mxf_reader> ${test_file} test.dat
)
# Requires output of tests in ../writeavidmxf
set_tests_properties(libMXF_reader_${test}_film23.976 PROPERTIES
FIXTURES_REQUIRED writeavidmxf_samples
)
endforeach()
endif()