diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-12-22 08:35:55 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-12-22 08:35:55 +0000 |
commit | 784e9f347be5efef42ad23afbda12f6fc64d6093 (patch) | |
tree | abc23f87c11791b85f2f06bf8204655cdf070726 /modules | |
parent | 3d781e4e0c12d4cf1296403d176c416a09f47852 (diff) | |
download | extra-cmake-modules-784e9f347be5efef42ad23afbda12f6fc64d6093.tar.gz extra-cmake-modules-784e9f347be5efef42ad23afbda12f6fc64d6093.tar.bz2 |
-use FindPkgConfig.cmake instead of UsePkgConfig.cmake
Alex
CCMAIL: kretz@kde.org
Matthias: please check that it still works for you, it does on my machine (e.g. by running cmake -DMODULE=FFmpeg -P RunAllModuleTests.cmake in kdelibs/cmake/module-tests/ )
svn path=/trunk/KDE/kdelibs/; revision=900098
Diffstat (limited to 'modules')
-rw-r--r-- | modules/FindFFmpeg.cmake | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/modules/FindFFmpeg.cmake b/modules/FindFFmpeg.cmake index 16233510..d6259b0c 100644 --- a/modules/FindFFmpeg.cmake +++ b/modules/FindFFmpeg.cmake @@ -2,30 +2,32 @@ # Once done this will define # # FFMPEG_FOUND - system has ffmpeg +# FFMPEG_INCLUDE_DIR - Include directory necessary for using the ffmpeg headers # FFMPEG_LIBRARIES - Link these to use ffmpeg # FFMPEG_DEFINITIONS - Compiler switches required for using ffmpeg # Copyright (c) 2006, Matthias Kretz, <kretz@kde.org> +# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org> # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. -if (FFMPEG_LIBRARIES)# AND FFMPEG_DEFINITIONS) +if (FFMPEG_LIBRARIES) # in cache already set(FFMPEG_FOUND TRUE) -else (FFMPEG_LIBRARIES)# AND FFMPEG_DEFINITIONS) +else (FFMPEG_LIBRARIES) if (NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - include(UsePkgConfig) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_LIBAVCODEC libavcodec) + set(FFMPEG_DEFINITIONS ${PC_LIBAVCODEC_CFLAGS_OTHER}) - pkgconfig(libavcodec _FFMPEGIncDir _FFMPEGLinkDir _FFMPEGLinkFlags _FFMPEGCflags) endif (NOT WIN32) - #set(FFMPEG_DEFINITIONS ${_FFMPEGCflags}) # # #include <libXXXX/XXXX.h> is the new style for FFMPEG headers @@ -35,38 +37,40 @@ endif (NOT WIN32) # installation. # find_path(FFMPEG_INCLUDE_DIR libavcodec/avcodec.h - PATHS - ${_FFMPEGIncDir} - NO_DEFAULT_PATH + HINTS + ${PC_LIBAVCODEC_INCLUDEDIR} + ${PC_LIBAVCODEC_INCLUDE_DIRS} ) # also search for the old style include dir, just for the purpose # of giving a useful error message if an old libavcodec is installed # and the user might wonder why it is not found find_path(FFMPEG_INCLUDE_DIR_OLD_STYLE ffmpeg/avcodec.h - PATHS - ${_FFMPEGIncDir} - NO_DEFAULT_PATH + HINTS + ${PC_LIBAVCODEC_INCLUDEDIR} + ${PC_LIBAVCODEC_INCLUDE_DIRS} ) find_library(AVCODEC_LIBRARIES NAMES avcodec - PATHS - ${_FFMPEGLinkDir} - NO_DEFAULT_PATH + HINTS + ${PC_LIBAVCODEC_LIBDIR} + ${PC_LIBAVCODEC_LIBRARY_DIRS} ) find_library(AVFORMAT_LIBRARIES NAMES avformat - PATHS - ${_FFMPEGLinkDir} - NO_DEFAULT_PATH + HINTS + ${PC_LIBAVCODEC_LIBDIR} + ${PC_LIBAVCODEC_LIBRARY_DIRS} ) find_library(AVUTIL_LIBRARIES NAMES avutil - PATHS - ${_FFMPEGLinkDir} - NO_DEFAULT_PATH + HINTS + ${PC_LIBAVCODEC_LIBDIR} + ${PC_LIBAVCODEC_LIBRARY_DIRS} ) + + set(FFMPEG_LIBRARIES ) if (AVCODEC_LIBRARIES) set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVCODEC_LIBRARIES}) |