]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | cmake_minimum_required(VERSION 3.2) |
2 | project(libmpeg2) | |
3 | ||
4 | option(TOOLS "Build libmpeg2 tools" OFF) | |
5 | ||
6 | set(MPEG2_SOURCE_FILES | |
7 | libmpeg2/alloc.c | |
8 | libmpeg2/cpu_accel.c | |
9 | libmpeg2/cpu_state.c | |
10 | libmpeg2/decode.c | |
11 | libmpeg2/header.c | |
12 | libmpeg2/idct.c | |
13 | libmpeg2/idct_alpha.c | |
14 | libmpeg2/idct_altivec.c | |
15 | #libmpeg2/idct_mmx.c | |
16 | libmpeg2/motion_comp.c | |
17 | libmpeg2/motion_comp_alpha.c | |
18 | libmpeg2/motion_comp_altivec.c | |
19 | libmpeg2/motion_comp_arm.c | |
20 | #libmpeg2/motion_comp_mmx.c | |
21 | libmpeg2/motion_comp_vis.c | |
22 | libmpeg2/slice.c | |
23 | ) | |
24 | set(VO_SOURCE_FILES | |
25 | libvo/video_out.c | |
26 | libvo/video_out_dx.c | |
27 | libvo/video_out_null.c | |
28 | libvo/video_out_pgm.c | |
29 | libvo/video_out_sdl.c | |
30 | libvo/video_out_x11.c | |
31 | ) | |
32 | set(MPEG2_CONVERT_SOURCES | |
33 | libmpeg2/convert/rgb.c | |
34 | #libmpeg2/convert/rgb_mmx.c | |
35 | libmpeg2/convert/rgb_vis.c | |
36 | libmpeg2/convert/uyvy.c | |
37 | ) | |
38 | set(GETOPT_FILES | |
39 | src/getopt.c | |
40 | ) | |
41 | set(HEADERS | |
42 | include/mpeg2.h | |
43 | include/mpeg2convert.h | |
44 | ) | |
45 | ||
46 | add_library(mpeg2 ${MPEG2_SOURCE_FILES}) | |
47 | add_library(mpeg2convert ${MPEG2_CONVERT_SOURCES}) | |
48 | add_library(getopt STATIC ${GETOPT_FILES}) | |
49 | add_library(vo STATIC ${VO_SOURCE_FILES}) | |
50 | ||
51 | target_include_directories(mpeg2convert PUBLIC | |
52 | "${CMAKE_SOURCE_DIR}/vc++" | |
53 | "${CMAKE_SOURCE_DIR}/include" | |
54 | ) | |
55 | target_include_directories(getopt PUBLIC | |
56 | "${CMAKE_SOURCE_DIR}/vc++" | |
57 | "${CMAKE_SOURCE_DIR}/include" | |
58 | ) | |
59 | target_include_directories(vo PUBLIC | |
60 | "${CMAKE_SOURCE_DIR}/vc++" | |
61 | "${CMAKE_SOURCE_DIR}/include" | |
62 | ) | |
63 | target_include_directories(mpeg2 PUBLIC | |
64 | "${CMAKE_SOURCE_DIR}/vc++" | |
65 | "${CMAKE_SOURCE_DIR}/include" | |
66 | ) | |
67 | target_include_directories(mpeg2 INTERFACE | |
68 | "${CMAKE_SOURCE_DIR}/include" | |
69 | ) | |
70 | ||
71 | target_compile_definitions(getopt PUBLIC HAVE_CONFIG_H) | |
72 | target_link_libraries(vo mpeg2convert) | |
73 | ||
74 | if (TOOLS) | |
75 | add_executable(mpeg2dec src/mpeg2dec.c src/dump_state.c src/gettimeofday.c) | |
76 | add_executable(extract_mpeg2 src/extract_mpeg2.c) | |
77 | add_executable(corrupt_mpeg2 src/corrupt_mpeg2.c) | |
78 | ||
79 | target_compile_definitions(extract_mpeg2 PUBLIC HAVE_CONFIG_H) | |
80 | target_compile_definitions(corrupt_mpeg2 PUBLIC HAVE_CONFIG_H) | |
81 | ||
82 | target_link_libraries(mpeg2dec PRIVATE getopt vo mpeg2convert mpeg2 gdi32) | |
83 | target_link_libraries(extract_mpeg2 PRIVATE getopt) | |
84 | target_link_libraries(corrupt_mpeg2 PRIVATE getopt) | |
85 | ||
86 | target_include_directories(mpeg2dec PUBLIC | |
87 | "${CMAKE_SOURCE_DIR}/vc++" | |
88 | "${CMAKE_SOURCE_DIR}/include" | |
89 | "${CMAKE_SOURCE_DIR}/src" | |
90 | ) | |
91 | target_include_directories(extract_mpeg2 PUBLIC | |
92 | "${CMAKE_SOURCE_DIR}/vc++" | |
93 | "${CMAKE_SOURCE_DIR}/include" | |
94 | "${CMAKE_SOURCE_DIR}/src" | |
95 | ) | |
96 | target_include_directories(corrupt_mpeg2 PUBLIC | |
97 | "${CMAKE_SOURCE_DIR}/vc++" | |
98 | "${CMAKE_SOURCE_DIR}/include" | |
99 | "${CMAKE_SOURCE_DIR}/src" | |
100 | ) | |
101 | endif (TOOLS) | |
102 | ||
103 | install(TARGETS mpeg2 | |
104 | EXPORT libmpeg2 | |
105 | LIBRARY DESTINATION lib | |
106 | ) | |
107 | ||
108 | install(FILES ${HEADERS} DESTINATION "include/mpeg2dec") |