Skip to content

Commit

Permalink
Check if the header exists before reading from it
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Feb 12, 2025
1 parent 017f5d4 commit eb2b8b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/FindFFmpeg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ macro(find_component _component _pkgconfig _library _header)
if(DEFINED ${PC_${_component}_VERSION})
set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING
"The ${_component} version number." FORCE)
else()
elseif(EXISTS "${${_component}_INCLUDE_DIRS}/${_pkgconfig}/version.h")
if(EXISTS "${${_component}_INCLUDE_DIRS}/${_pkgconfig}/version_major.h")
file(STRINGS "${${_component}_INCLUDE_DIRS}/${_pkgconfig}/version_major.h" majorver
REGEX "^#define[ \t]+LIB${_component}_VERSION_MAJOR[ \t]+[0-9]+$")
Expand Down

0 comments on commit eb2b8b8

Please sign in to comment.