1 find_package(PkgConfig)
2 pkg_check_modules(_OGG QUIET ogg)
4 find_path(_OGG_INCLUDE_DIR
6 PATHS ${_OGG_INCLUDE_DIRS})
8 find_library(_OGG_LIBRARY
10 HINTS ${_OGG_LIBRARY_DIRS})
12 find_library(_OGG_LIBRARY_STATIC
13 NAMES libogg.a libogg_static
14 HINTS ${_OGG_LIBRARY_DIRS})
16 include(FindPackageHandleStandardArgs)
17 find_package_handle_standard_args(OGG
18 REQUIRED_VARS _OGG_INCLUDE_DIR _OGG_LIBRARY
19 VERSION_VAR _OGG_VERSION)
23 add_library(Ogg::Ogg UNKNOWN IMPORTED)
24 set_target_properties(Ogg::Ogg PROPERTIES
25 INTERFACE_INCLUDE_DIRECTORIES "${_OGG_INCLUDE_DIR}"
26 IMPORTED_LOCATION "${_OGG_LIBRARY}")
28 if(NOT Ogg::Ogg-static AND _OGG_LIBRARY_STATIC)
29 add_library(Ogg::Ogg-static STATIC IMPORTED)
30 set_target_properties(Ogg::Ogg-static PROPERTIES
31 INTERFACE_INCLUDE_DIRECTORIES "${_OGG_INCLUDE_DIR}"
32 IMPORTED_LOCATION "${_OGG_LIBRARY_STATIC}")