Commit 6a418a89 authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Put CONDA_PREFIX second priority of ffmpeg search path (#2312)

Summary:
Change the cmake logic to search CONDA_PREFIX before falling back
to the other default paths and system paths.

1. FFMPEG_ROOT
2. CONDA_PREFIX
3. Other locations (Package managers and system paths)

For users with regular conda installation, ffmpeg from conda should
be picked automatically.
If anyone wants to specify the ffmpeg, then can set FFMPEG_ROOT
variable to the location of desired installation.

Pull Request resolved: https://github.com/pytorch/audio/pull/2312

Reviewed By: hwangjeff

Differential Revision: D35317383

Pulled By: mthrok

fbshipit-source-id: 52aef8f3f7f0f8f1eaf7a89a2d1ccfb6265e2c50
parent 72f9a4e3
...@@ -84,6 +84,14 @@ function (_ffmpeg_find component headername) ...@@ -84,6 +84,14 @@ function (_ffmpeg_find component headername)
"lib${component}/${headername}" "lib${component}/${headername}"
PATHS PATHS
"$ENV{CONDA_PREFIX}/include" "$ENV{CONDA_PREFIX}/include"
PATH_SUFFIXES
ffmpeg
DOC "FFMPEG's ${component} include directory"
NO_DEFAULT_PATH)
find_path("FFMPEG_${component}_INCLUDE_DIR"
NAMES
"lib${component}/${headername}"
PATHS
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
/usr/local/include /usr/local/include
...@@ -109,6 +117,7 @@ function (_ffmpeg_find component headername) ...@@ -109,6 +117,7 @@ function (_ffmpeg_find component headername)
"${component}" "${component}"
PATHS PATHS
"$ENV{FFMPEG_ROOT}/lib" "$ENV{FFMPEG_ROOT}/lib"
"$ENV{FFMPEG_ROOT}/bin"
DOC "FFMPEG's ${component} library" DOC "FFMPEG's ${component} library"
NO_DEFAULT_PATH) NO_DEFAULT_PATH)
find_library("FFMPEG_${component}_LIBRARY" find_library("FFMPEG_${component}_LIBRARY"
...@@ -116,6 +125,13 @@ function (_ffmpeg_find component headername) ...@@ -116,6 +125,13 @@ function (_ffmpeg_find component headername)
"${component}" "${component}"
PATHS PATHS
"$ENV{CONDA_PREFIX}/lib" "$ENV{CONDA_PREFIX}/lib"
"$ENV{CONDA_PREFIX}/bin"
DOC "FFMPEG's ${component} library"
NO_DEFAULT_PATH)
find_library("FFMPEG_${component}_LIBRARY"
NAMES
"${component}"
PATHS
~/Library/Frameworks ~/Library/Frameworks
/Library/Frameworks /Library/Frameworks
/usr/local/lib /usr/local/lib
...@@ -127,7 +143,6 @@ function (_ffmpeg_find component headername) ...@@ -127,7 +143,6 @@ function (_ffmpeg_find component headername)
/opt/csw/lib /opt/csw/lib
/opt/lib /opt/lib
/usr/freeware/lib64 /usr/freeware/lib64
"$ENV{FFMPEG_ROOT}/bin"
DOC "FFMPEG's ${component} library") DOC "FFMPEG's ${component} library")
mark_as_advanced("FFMPEG_${component}_LIBRARY") mark_as_advanced("FFMPEG_${component}_LIBRARY")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment