Debian Codegraph @

Xpjproject/cmake/FindResample.cmake

raw
1 find_package(PkgConfig QUIET)
2 if(PKG_CONFIG_FOUND)
3 pkg_search_module(PC_Resample QUIET resample libresample)
4 set(Resample_VERSION ${PC_Resample_VERSION})
5 endif()
6
7 find_path(Resample_INCLUDE_DIR
8 NAMES
9 "resamplesubs.h"
10 HINTS
11 ${PC_Resample_INCLUDEDIR}
12 ${PC_Resample_INCLUDE_DIRS}
13 PATH_SUFFIXES
14 resample
15 )
16 mark_as_advanced(Resample_INCLUDE_DIR)
17
18 find_library(Resample_LIBRARY
19 NAMES
20 resample
21 libresample
22 HINTS
23 ${PC_Resample_LIBDIR}
24 ${PC_Resample_LIBRARY_DIRS}
25 )
26 mark_as_advanced(Resample_LIBRARY)
27
28 include(FindPackageHandleStandardArgs)
29 find_package_handle_standard_args(Resample
30 REQUIRED_VARS
31 Resample_INCLUDE_DIR
32 Resample_LIBRARY
33 VERSION_VAR
34 Resample_VERSION
35 )
36
37 if(Resample_FOUND)
38 set(Resample_LIBRARIES ${Resample_LIBRARY})
39 set(Resample_INCLUDE_DIRS ${Resample_INCLUDE_DIR})
40 set(Resample_DEFINITIONS ${PC_Resample_CFLAGS_OTHER})
41
42 if(NOT TARGET Resample::Resample)
43 add_library(Resample::Resample UNKNOWN IMPORTED)
44 set_target_properties(Resample::Resample PROPERTIES
45 IMPORTED_LOCATION "${Resample_LIBRARIES}"
46 INTERFACE_INCLUDE_DIRECTORIES "${Resample_INCLUDE_DIRS}"
47 INTERFACE_COMPILE_OPTIONS "${Resample_DEFINITIONS}"
48 )
49 endif()
50 endif()