flac/cmake/FindOgg.cmake

27 lines
667 B
CMake
Raw Permalink Normal View History

2019-04-07 12:37:56 +03:00
find_package(PkgConfig)
pkg_check_modules(_OGG QUIET ogg)
2019-04-08 07:36:05 +03:00
find_path(OGG_INCLUDE_DIR
2019-04-07 12:37:56 +03:00
NAMES "ogg/ogg.h"
PATHS ${_OGG_INCLUDE_DIRS})
2019-04-07 12:37:56 +03:00
2019-04-08 07:36:05 +03:00
find_library(OGG_LIBRARY
2019-04-07 12:37:56 +03:00
NAMES ogg libogg
HINTS ${_OGG_LIBRARY_DIRS})
2019-04-07 12:37:56 +03:00
2019-04-08 07:36:05 +03:00
mark_as_advanced(
OGG_INCLUDE_DIR
2019-04-29 12:48:24 +03:00
OGG_LIBRARY)
2019-04-08 07:36:05 +03:00
2019-04-07 12:37:56 +03:00
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Ogg
2019-04-08 07:36:05 +03:00
REQUIRED_VARS OGG_INCLUDE_DIR OGG_LIBRARY
2019-04-07 12:37:56 +03:00
VERSION_VAR _OGG_VERSION)
2019-04-29 13:28:55 +03:00
if(OGG_FOUND AND NOT TARGET Ogg::ogg)
add_library(Ogg::ogg UNKNOWN IMPORTED)
set_target_properties(Ogg::ogg PROPERTIES
2019-04-29 12:48:24 +03:00
INTERFACE_INCLUDE_DIRECTORIES "${OGG_INCLUDE_DIR}"
IMPORTED_LOCATION "${OGG_LIBRARY}")
2019-04-07 12:37:56 +03:00
endif()