Bug 338266 - FindFFmpeg.cmake bug
Summary: FindFFmpeg.cmake bug
Status: RESOLVED FIXED
Alias: None
Product: buildsystem
Classification: Developer tools
Component: KDE4 (cmake) (show other bugs)
Version: unspecified
Platform: NetBSD pkgsrc All
: NOR normal
Target Milestone: ---
Assignee: Alexander Neundorf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-14 13:01 UTC by Thomas Klausner
Modified: 2014-08-15 11:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.14.1


Attachments
Patch fixing the problem. (527 bytes, text/x-cmake)
2014-08-14 13:01 UTC, Thomas Klausner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Klausner 2014-08-14 13:01:33 UTC
Created attachment 88253 [details]
Patch fixing the problem.

FindFFmpeg.cmake uses pkg-config to detect ffmpeg and saves the result in the the PC_${component} variable. Later it tries to confirm the result it got from pkg-config by searching for headers and libraries again. For this, it tries to give hints to the search process, but uses the PCLIB_${component} variable, which is never defined.

The attached patch (against git from today) fixes this.
Comment 1 Raphael Kubo da Costa 2014-08-15 10:20:56 UTC
Interesting, this has been broken since 2011.

I'll commit a slightly different fix that renames the variables passed to find_path() and find_library() instead: it is more common to call pkg-config based variables PC_$FOO instead of PC_LIB$FOO, and the calls to set(..._DEFINITIONS) and set(..._VERSION) reference the variable with that name.
Comment 2 Raphael Kubo da Costa 2014-08-15 10:26:40 UTC
Git commit f6d33b3a2d1077c91425819de145ba2e5ae3cd87 by Raphael Kubo da Costa.
Committed on 15/08/2014 at 10:21.
Pushed by rkcosta into branch 'KDE/4.14'.

FindFFmpeg: Use the right name for the pkg-config component variables.

Commit 3194a35e ("Rewritten FindFFmpeg.cmake") introduced a regression
in the find_component macro: the pkg_check_module() call uses
PC_${component} as the variable name, while the calls to find_path() and
find_library() use PC_LIB${component} instead.

Fix the calls to find_path() and find_library().

Based on a patch by Thomas Klausner <tk@giga.or.at>, thanks a lot!
CCMAIL:   tk@giga.or.at
FIXED-IN: 4.14.1

M  +4    -4    cmake/modules/FindFFmpeg.cmake

http://commits.kde.org/kdelibs/f6d33b3a2d1077c91425819de145ba2e5ae3cd87
Comment 3 Thomas Klausner 2014-08-15 11:30:31 UTC
On Fri, Aug 15, 2014 at 10:26:40AM +0000, Raphael Kubo da Costa wrote:
> https://bugs.kde.org/show_bug.cgi?id=338266
> 
> Raphael Kubo da Costa <rakuco@FreeBSD.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>          Resolution|---                         |FIXED
>              Status|UNCONFIRMED                 |RESOLVED
>    Version Fixed In|                            |4.14.1
>       Latest Commit|                            |http://commits.kde.org/kdel
>                    |                            |ibs/f6d33b3a2d1077c91425819
>                    |                            |de145ba2e5ae3cd87
> 
> --- Comment #2 from Raphael Kubo da Costa <rakuco@FreeBSD.org> ---
> Git commit f6d33b3a2d1077c91425819de145ba2e5ae3cd87 by Raphael Kubo da Costa.
> Committed on 15/08/2014 at 10:21.
> Pushed by rkcosta into branch 'KDE/4.14'.
> 
> FindFFmpeg: Use the right name for the pkg-config component variables.
> 
> Commit 3194a35e ("Rewritten FindFFmpeg.cmake") introduced a regression
> in the find_component macro: the pkg_check_module() call uses
> PC_${component} as the variable name, while the calls to find_path() and
> find_library() use PC_LIB${component} instead.
> 
> Fix the calls to find_path() and find_library().
> 
> Based on a patch by Thomas Klausner <tk@giga.or.at>, thanks a lot!
> CCMAIL:   tk@giga.or.at
> FIXED-IN: 4.14.1
> 
> M  +4    -4    cmake/modules/FindFFmpeg.cmake
> 
> http://commits.kde.org/kdelibs/f6d33b3a2d1077c91425819de145ba2e5ae3cd87

Thanks for fixing this so quickly!

The same file is distributed with ffmpegthumbs, so I had filed

https://bugs.kde.org/show_bug.cgi?id=338280

which can either be closed now, or whenever the files are synced, if
there are multiple copies.
 Thomas