File: FindOGGTHEORA.cmake

package info (click to toggle)
vtk6 6.3.0%2Bdfsg2-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 118,880 kB
  • sloc: cpp: 1,442,792; ansic: 113,395; python: 72,383; tcl: 46,998; xml: 8,119; yacc: 4,525; java: 4,239; perl: 3,108; lex: 1,694; sh: 1,093; asm: 154; makefile: 103; objc: 17
file content (62 lines) | stat: -rw-r--r-- 1,864 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# Find the native Ogg/Theora includes and libraries
#
# This module defines
# OGGTHEORA_INCLUDE_DIR, where to find ogg/ogg.h and theora/theora.h
# OGGTHEORA_LIBRARIES, the libraries to link against to use Ogg/Theora.
# OGGTHEORA_FOUND, If false, do not try to use Ogg/Theora.

FIND_PATH(OGGTHEORA_ogg_INCLUDE_DIR ogg/ogg.h)

FIND_PATH(OGGTHEORA_theora_INCLUDE_DIR theora/theora.h)

FIND_LIBRARY(OGGTHEORA_ogg_LIBRARY ogg)

FIND_LIBRARY(OGGTHEORA_theoraenc_LIBRARY theoraenc)

FIND_LIBRARY(OGGTHEORA_theoradec_LIBRARY theoradec)

SET(OGGTHEORA_INCLUDE_DIRS
  ${OGGTHEORA_ogg_INCLUDE_DIR}
  ${OGGTHEORA_theora_INCLUDE_DIR}
  )
#HACK multiple directories
SET(OGGTHEORA_INCLUDE_DIR ${OGGTHEORA_INCLUDE_DIRS})

SET(OGGTHEORA_LIBRARIES
  ${OGGTHEORA_theoraenc_LIBRARY}
  ${OGGTHEORA_theoradec_LIBRARY}
  ${OGGTHEORA_ogg_LIBRARY}
  )
#HACK multiple libraries
SET(OGGTHEORA_LIBRARY ${OGGTHEORA_LIBRARIES})

GET_FILENAME_COMPONENT(_CURRENT_DIR  "${CMAKE_CURRENT_LIST_FILE}" PATH)

TRY_RUN(
  OGGTHEORA_NO_444_SUBSAMPLING _OGGTHEORA_COMPILE_SUCCESS
  "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestOggTheoraSubsampling"
  "${_CURRENT_DIR}/TestOggTheoraSubsampling.c"
  CMAKE_FLAGS
  "-DINCLUDE_DIRECTORIES:STRING=${OGGTHEORA_INCLUDE_DIRS}"
  "-DLINK_LIBRARIES:STRING=${OGGTHEORA_LIBRARIES}"
  )

IF(NOT _OGGTHEORA_COMPILE_SUCCESS)
  MESSAGE(SEND_ERROR "Failed to compile ${_CURRENT_DIR}/TestOggTheoraSubsampling.c")
ENDIF()

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGGTHEORA
  "Could NOT find the ogg and theora libraries"
  OGGTHEORA_ogg_LIBRARY
  OGGTHEORA_theoraenc_LIBRARY
  OGGTHEORA_theoradec_LIBRARY
  OGGTHEORA_ogg_INCLUDE_DIR
  OGGTHEORA_theora_INCLUDE_DIR
  )

MARK_AS_ADVANCED(OGGTHEORA_ogg_INCLUDE_DIR OGGTHEORA_theora_INCLUDE_DIR
  OGGTHEORA_ogg_LIBRARY OGGTHEORA_theoraenc_LIBRARY
  OGGTHEORA_theoradec_LIBRARY
  )