Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the CMake find_library command to find the FFmpeg libraries. #3663

Merged
merged 5 commits into from
Feb 18, 2015
Merged

Use the CMake find_library command to find the FFmpeg libraries. #3663

merged 5 commits into from
Feb 18, 2015

Conversation

mansourmoufid
Copy link
Contributor

No description provided.

@mansourmoufid
Copy link
Contributor Author

I build the FFmpeg libraries on OS X as dynamic libraries only, with this patch OpenCV can find the libraries.

endif()
endif()
find_library(FFMPEG_CODEC_LIB
NAMES "libavcodec.a" "libavcodec.dylib"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't simply "avcodec" be enough?

@mansourmoufid
Copy link
Contributor Author

Thanks for the feedback, I committed the changes.

But, without setting the version variables, I get:

--     FFMPEG:                      YES
--       codec:                     YES (ver 55.69.100)
--       format:                    YES (ver 55.48.100)
--       util:                      YES (ver 52.92.100)
--       swscale:                   YES (ver 2.6.100)
--       gentoo-style:              YES

but with them, the versions are all "Unknown". I think pkg-config finds the correct versions, right?

@SpecLad
Copy link

SpecLad commented Feb 3, 2015

Wait, so you found it through pkg-config?

Hmm, now that I've taken a more thorough look at the general logic, it looks like the if(APPLE) branch should really be the else branch to if(HAVE_FFMPEG) just above, since 1) there's no point in running it if FFmpeg is already found, and 2) it's not OS X-specific at all. Could you try making that change?

@mansourmoufid
Copy link
Contributor Author

You're right, CMake is definitely using pkg-config. The UNIX variable is defined for OS X, and if I remove the elseif(UNIX) block, the find_library commands alone fail to find the libraries.

I moved the if(APPLE) block into a new else branch.

@SpecLad
Copy link

SpecLad commented Feb 4, 2015

That's exactly what I meant, thanks.

However, you definitely need to bring the version variable setting back, since in this branch it can now be assumed that pkg-config didn't find anything.

@SpecLad
Copy link

SpecLad commented Feb 11, 2015

👍

@opencv-pushbot opencv-pushbot merged commit c60fa84 into opencv:2.4 Feb 18, 2015
@mansourmoufid mansourmoufid deleted the ffmpeg-dylib branch March 19, 2015 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port/backport done Label for maintainers. Authors of PR can ignore this
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants