Final polisihing for KDE4:
[kdemultimedia.git] / cmake / modules / FindTheora.cmake
blobcda75bbdbee8ab59bdb2c6be2c4c1c6e90030179
1 # Option for build or not Theora
3 # Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
5 # Redistribution and use is allowed according to the terms of the BSD license.
6 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
9 if(THEORA_INCLUDE_DIR AND THEORA_LIB_LIBRARIES AND THEORA_VORBIS_LIBRARIES AND THEORA_OGG_LIBRARIES)
10         # Already in cache, be silent
11         set(Theora_FIND_QUIETLY TRUE)   
12 endif(THEORA_INCLUDE_DIR AND THEORA_LIB_LIBRARIES AND THEORA_VORBIS_LIBRARIES AND THEORA_OGG_LIBRARIES)
14 FIND_PATH(THEORA_INCLUDE_DIR theora/theora.h)
16 FIND_LIBRARY(THEORA_OGG_LIBRARIES NAMES ogg )
18 FIND_LIBRARY(THEORA_VORBIS_LIBRARIES NAMES vorbis)
20 FIND_LIBRARY(THEORA_LIB_LIBRARIES NAMES theora)
22 if(THEORA_LIB_LIBRARIES AND THEORA_VORBIS_LIBRARIES AND THEORA_OGG_LIBRARIES AND THEORA_INCLUDE_DIR)
23         set(THEORA_LIBRARY ${THEORA_LIB_LIBRARIES} ${THEORA_OGG_LIBRARIES} ${THEORA_VORBIS_LIBRARIES})
24         set(THEORA_FOUND TRUE)
25 endif(THEORA_LIB_LIBRARIES AND THEORA_VORBIS_LIBRARIES AND THEORA_OGG_LIBRARIES AND THEORA_INCLUDE_DIR)
27 if (THEORA_FOUND)
28   if (NOT Theora_FIND_QUIETLY)
29      MESSAGE( STATUS "theora found: includes in ${THEORA_INCLUDE_DIR}, library in ${THEORA_LIBRARY}")
30   endif (NOT Theora_FIND_QUIETLY)
31 else (THEORA_FOUND)
32   if (Theora_FIND_REQUIRED)
33      MESSAGE( FATAL_ERROR "theora not found")
34   endif (Theora_FIND_REQUIRED)
35 endif (THEORA_FOUND)
38 MARK_AS_ADVANCED(THEORA_INCLUDE_DIR THEORA_LIBRARY)