aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-07-20 22:36:02 +0000
committerAlexander Neundorf <neundorf@kde.org>2008-07-20 22:36:02 +0000
commitd87b53240577e1228d49dd309092b1aea5c8621b (patch)
treeafbe1093cf6ade6249c8b9b359551f73e89d8ae4
parent09adc1e34b027d8be325ac2c3243f0cfdf090df4 (diff)
downloadextra-cmake-modules-d87b53240577e1228d49dd309092b1aea5c8621b.tar.gz
extra-cmake-modules-d87b53240577e1228d49dd309092b1aea5c8621b.tar.bz2
-consistent lowercasing
-use mark_as_advanced() for the right variables (i.e. the ones which go into the cache) -also search for the old style header so we can give a better error message Alex svn path=/trunk/KDE/kdelibs/; revision=835669
-rw-r--r--modules/FindFFmpeg.cmake38
1 files changed, 30 insertions, 8 deletions
diff --git a/modules/FindFFmpeg.cmake b/modules/FindFFmpeg.cmake
index 8baf0af7..16233510 100644
--- a/modules/FindFFmpeg.cmake
+++ b/modules/FindFFmpeg.cmake
@@ -17,13 +17,14 @@ if (FFMPEG_LIBRARIES)# AND FFMPEG_DEFINITIONS)
set(FFMPEG_FOUND TRUE)
else (FFMPEG_LIBRARIES)# AND FFMPEG_DEFINITIONS)
-IF (NOT WIN32)
+
+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)
+ include(UsePkgConfig)
- PKGCONFIG(libavcodec _FFMPEGIncDir _FFMPEGLinkDir _FFMPEGLinkFlags _FFMPEGCflags)
-ENDIF (NOT WIN32)
+ pkgconfig(libavcodec _FFMPEGIncDir _FFMPEGLinkDir _FFMPEGLinkFlags _FFMPEGCflags)
+endif (NOT WIN32)
#set(FFMPEG_DEFINITIONS ${_FFMPEGCflags})
#
@@ -39,6 +40,15 @@ ENDIF (NOT WIN32)
NO_DEFAULT_PATH
)
+ # 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
+ )
+
find_library(AVCODEC_LIBRARIES NAMES avcodec
PATHS
${_FFMPEGLinkDir}
@@ -70,21 +80,33 @@ ENDIF (NOT WIN32)
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${AVUTIL_LIBRARIES})
endif (AVUTIL_LIBRARIES)
- if (FFMPEG_LIBRARIES)
+ if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
set(FFMPEG_FOUND TRUE)
- endif (FFMPEG_LIBRARIES)
+ endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
if (FFMPEG_FOUND)
if (NOT FFmpeg_FIND_QUIETLY)
message(STATUS "Found FFMPEG: ${FFMPEG_LIBRARIES} ${FFMPEG_INCLUDE_DIR}")
endif (NOT FFmpeg_FIND_QUIETLY)
else (FFMPEG_FOUND)
+ # only an old libavcodec was found ?
+ if (FFMPEG_INCLUDE_DIR_OLD_STYLE AND NOT FFMPEG_INCLUDE_DIR AND NOT FFmpeg_FIND_QUIETLY)
+ message(STATUS "Found old version of libavcodec, but a newer version is required.")
+ endif (FFMPEG_INCLUDE_DIR_OLD_STYLE AND NOT FFMPEG_INCLUDE_DIR AND NOT FFmpeg_FIND_QUIETLY)
+
if (FFmpeg_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find FFMPEG")
+ else (FFmpeg_FIND_REQUIRED)
+ if (NOT FFmpeg_FIND_QUIETLY)
+ message(STATUS "Could NOT find FFMPEG")
+ endif (NOT FFmpeg_FIND_QUIETLY)
endif (FFmpeg_FIND_REQUIRED)
endif (FFMPEG_FOUND)
- MARK_AS_ADVANCED(FFMPEG_LIBRARIES)
- MARK_AS_ADVANCED(FFMPEG_INCLUDE_DIR)
+ mark_as_advanced(AVCODEC_LIBRARIES
+ AVFORMAT_LIBRARIES
+ AVUTIL_LIBRARIES
+ FFMPEG_INCLUDE_DIR
+ FFMPEG_INCLUDE_DIR_OLD_STYLE)
endif (FFMPEG_LIBRARIES)# AND FFMPEG_DEFINITIONS)