libFLAC++: Add libFLAC++-static.la target for oss-fuzzers
[flac.git] / cmake / FindOGG.cmake
blob7f424126a9ad8961aee33be03cd5c1ee296233fa
1 find_package(PkgConfig)
2 pkg_check_modules(_OGG QUIET ogg)
4 find_path(OGG_INCLUDE_DIR
5     NAMES "ogg/ogg.h"
6     PATHS ${_OGG_INCLUDE_DIRS})
8 find_library(OGG_LIBRARY
9     NAMES ogg libogg
10     HINTS ${_OGG_LIBRARY_DIRS})
12 mark_as_advanced(
13     OGG_INCLUDE_DIR
14     OGG_LIBRARY)
16 include(FindPackageHandleStandardArgs)
17 find_package_handle_standard_args(OGG
18     REQUIRED_VARS OGG_INCLUDE_DIR OGG_LIBRARY
19     VERSION_VAR _OGG_VERSION)
21 if(OGG_FOUND AND NOT TARGET Ogg::ogg)
22     add_library(Ogg::ogg UNKNOWN IMPORTED)
23     set_target_properties(Ogg::ogg PROPERTIES
24         INTERFACE_INCLUDE_DIRECTORIES "${OGG_INCLUDE_DIR}"
25         IMPORTED_LOCATION "${OGG_LIBRARY}")
26 endif()