File tree Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Expand file tree Collapse file tree 1 file changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -76,25 +76,12 @@ macro(find_component COMPONENT PKGCONFIG LIBRARY HEADER)
76
76
)
77
77
endmacro ()
78
78
79
- # Get FFmpeg from custom install
80
- if (FFMPEG_LIBRARY_DIR AND FFMPEG_INCLUDE_DIR )
81
- set (FFMPEG_FOUND TRUE )
82
- if (WIN32 )
83
- file (GLOB FFMPEG_LIBRARIES "${FFMPEG_LIBRARY_DIR} /*.lib" )
84
- else ()
85
- file (GLOB FFMPEG_LIBRARIES "${FFMPEG_LIBRARY_DIR} /*.so" )
86
- endif ()
87
- # Get FFmpeg from system install
88
- else ()
89
- # Check FFmpeg version
90
- if (DEFINED FFmpeg_FIND_VERSION )
91
- check_ffmpeg_version ()
92
- endif ()
93
-
94
- if (NOT FFmpeg_FIND_COMPONENTS )
95
- set (FFmpeg_FIND_COMPONENTS avcodec avformat avutil )
96
- endif ()
97
-
79
+ ### Macro: manage_components
80
+ # Define CMake variables for each component defined in FFmpeg_FIND_COMPONENTS
81
+ # Send error if a required component is missing (warning if not required)
82
+ # Set if FFMPEG is found
83
+ #
84
+ macro (manage_components )
98
85
# Check components and add their stuff to the FFMPEG_* vars.
99
86
foreach (COMPONENT ${FFmpeg_FIND_COMPONENTS} )
100
87
# Get component name is lower cases.
@@ -120,4 +107,17 @@ else()
120
107
list (REMOVE_DUPLICATES FFMPEG_INCLUDE_DIR )
121
108
set (FFMPEG_FOUND TRUE )
122
109
endif ()
110
+ endmacro ()
111
+
112
+ # Check FFmpeg version
113
+ if (DEFINED FFmpeg_FIND_VERSION )
114
+ check_ffmpeg_version ()
123
115
endif ()
116
+
117
+ # Get basic components if no one is indicated
118
+ if (NOT FFmpeg_FIND_COMPONENTS )
119
+ set (FFmpeg_FIND_COMPONENTS avcodec avformat avutil )
120
+ endif ()
121
+
122
+ # Check each component
123
+ manage_components ()
You can’t perform that action at this time.
0 commit comments