blob: 43d285eb377c1f1473fa2ca36cb8fb042626a655 (
plain) (
blame)
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
63
64
65
66
67
|
# - Try to find opusfile
#
# Once done this will define
#
# OPUSFILE_FOUND - system has opusfile
# OPUSFILE_INCLUDE_DIRS - the opusfile include directories
# OPUSFILE_LIBRARIES - Link these to use opusfile
# OPUSFILE_CFLAGS - Compile options to use opusfile
# opusfile::opusfile - Imported library of opusfile
#
# FIXME: opusfile does not ship an official opusfile cmake script,
# rename this file/variables/target when/if it has.
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_search_module(PKG_OPUSFILE "opusfile")
endif()
find_path(OPUSFILE_INCLUDE_DIR
NAMES
opusfile.h
PATH_SUFFIXES
opusfile
HINTS
${PKG_OPUSFILE_INCLUDE_DIRS}
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
find_library(OPUSFILE_LIBRARY
NAMES
opusfile
HINTS
${PKG_OPUSFILE_LIBRARIES}
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
set(OPUSFILE_CFLAGS "${PKG_OPUSFILE_CFLAGS_OTHER}" CACHE STRING "CFLAGS of opusfile")
set(OPUSFILE_INCLUDE_DIRS "${OPUSFILE_INCLUDE_DIR}")
set(OPUSFILE_LIBRARIES "${OPUSFILE_LIBRARY}")
if (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES)
set(OPUSFILE_FOUND TRUE)
endif (OPUSFILE_INCLUDE_DIRS AND OPUSFILE_LIBRARIES)
# handle the QUIETLY and REQUIRED arguments and set Opusfile_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(opusfile DEFAULT_MSG OPUSFILE_INCLUDE_DIRS OPUSFILE_LIBRARIES)
if(NOT TARGET opusfile::opusfile)
add_library(__opusfile INTERFACE)
target_compile_options(__opusfile INTERFACE ${OPUSFILE_CFLAGS})
target_include_directories(__opusfile INTERFACE ${OPUSFILE_INCLUDE_DIRS})
target_link_libraries(__opusfile INTERFACE ${OPUSFILE_LIBRARIES})
add_library(opusfile::opusfile ALIAS __opusfile)
endif()
|