30 lines
950 B
CMake
30 lines
950 B
CMake
# SPDX-FileCopyrightText: 2026 <copyright holder> <email>
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# - Try to find
|
|
# Once done this will define
|
|
# _FOUND - System has
|
|
# _INCLUDE_DIRS - The include directories
|
|
# _LIBRARIES - The libraries needed to use
|
|
# _DEFINITIONS - Compiler switches required for using
|
|
|
|
find_package(PkgConfig)
|
|
pkg_check_modules(PC_ QUIET )
|
|
set(_DEFINITIONS ${PC__CFLAGS_OTHER})
|
|
|
|
find_path(_INCLUDE_DIR
|
|
HINTS ${PC__INCLUDEDIR} ${PC__INCLUDE_DIRS}
|
|
PATH_SUFFIXES )
|
|
|
|
find_library(_LIBRARY NAMES
|
|
HINTS ${PC__LIBDIR} ${PC__LIBRARY_DIRS} )
|
|
|
|
set(_LIBRARIES ${_LIBRARY} )
|
|
set(_INCLUDE_DIRS ${_INCLUDE_DIR} )
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
# handle the QUIETLY and REQUIRED arguments and set _FOUND to TRUE
|
|
# if all listed variables are TRUE
|
|
find_package_handle_standard_args( DEFAULT_MSG
|
|
_LIBRARY _INCLUDE_DIR)
|
|
mark_as_advanced(_INCLUDE_DIR _LIBRARY )
|