summaryrefslogtreecommitdiffstats
path: root/cmake/FindFFmpeg.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindFFmpeg.cmake')
-rw-r--r--cmake/FindFFmpeg.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/FindFFmpeg.cmake b/cmake/FindFFmpeg.cmake
index bb7cf1ea9..1ee312578 100644
--- a/cmake/FindFFmpeg.cmake
+++ b/cmake/FindFFmpeg.cmake
@@ -102,6 +102,18 @@ macro(find_component _component _pkgconfig _library _header)
pkg_check_modules(PC_${_component} ${_pkgconfig})
endif ()
+ if (FFMPEG_DIR OR FFMPEG_ROOT)
+ set(__find_ffmpeg_backup_root_dir "${CMAKE_FIND_ROOT_PATH}")
+ endif()
+
+ if(FFMPEG_DIR)
+ list(APPEND CMAKE_FIND_ROOT_PATH "${FFMPEG_DIR}")
+ endif()
+
+ if(FFMPEG_ROOT)
+ list(APPEND CMAKE_FIND_ROOT_PATH "${FFMPEG_ROOT}")
+ endif()
+
find_path(${_component}_INCLUDE_DIRS ${_header}
HINTS
${PC_${_component}_INCLUDEDIR}
@@ -124,6 +136,10 @@ macro(find_component _component _pkgconfig _library _header)
lib
)
+ if(FFMPEG_DIR OR FFMPEG_ROOT)
+ set(CMAKE_FIND_ROOT_PATH "${__find_ffmpeg_backup_root_dir}")
+ endif()
+
get_filename_component(${_component}_LIBRARY_DIR_FROM_FIND ${${_component}_LIBRARY} DIRECTORY)
get_filename_component(${_component}_LIBRARY_FROM_FIND ${${_component}_LIBRARY} NAME)