aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-08-12 09:48:17 -0700
committerChris Robinson <[email protected]>2020-08-12 09:48:17 -0700
commited1135f7aea649bf3f17c88bc8510e30a61bed5c (patch)
treeaf08b242cd9d8b64248a973460ce76dc4d1c5709 /cmake
parent57d6df29b40652b67fb3564ec5ab9d36fc078232 (diff)
Fix configure-time ffmpeg version detection
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindFFmpeg.cmake14
1 files changed, 3 insertions, 11 deletions
diff --git a/cmake/FindFFmpeg.cmake b/cmake/FindFFmpeg.cmake
index c489c2c3..60ca68fd 100644
--- a/cmake/FindFFmpeg.cmake
+++ b/cmake/FindFFmpeg.cmake
@@ -84,17 +84,9 @@ macro(find_component _component _pkgconfig _library _header)
if(EXISTS "${${_component}_INCLUDE_DIRS}/${_ver_header}")
file(STRINGS "${${_component}_INCLUDE_DIRS}/${_ver_header}" version_str REGEX "^#define[\t ]+LIB${_component}_VERSION_M.*")
- foreach(_str "${version_str}")
- if(NOT version_maj)
- string(REGEX REPLACE "^.*LIB${_component}_VERSION_MAJOR[\t ]+([0-9]*).*$" "\\1" version_maj "${_str}")
- endif()
- if(NOT version_min)
- string(REGEX REPLACE "^.*LIB${_component}_VERSION_MINOR[\t ]+([0-9]*).*$" "\\1" version_min "${_str}")
- endif()
- if(NOT version_mic)
- string(REGEX REPLACE "^.*LIB${_component}_VERSION_MICRO[\t ]+([0-9]*).*$" "\\1" version_mic "${_str}")
- endif()
- endforeach()
+ string(REGEX REPLACE "^.*LIB${_component}_VERSION_MAJOR[\t ]+([0-9]*).*$" "\\1" version_maj "${version_str}")
+ string(REGEX REPLACE "^.*LIB${_component}_VERSION_MINOR[\t ]+([0-9]*).*$" "\\1" version_min "${version_str}")
+ string(REGEX REPLACE "^.*LIB${_component}_VERSION_MICRO[\t ]+([0-9]*).*$" "\\1" version_mic "${version_str}")
unset(version_str)
set(${_component}_VERSION "${version_maj}.${version_min}.${version_mic}" CACHE STRING "The ${_component} version number.")