INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_LIBAIRSPYHF libairspyhf)

FIND_PATH(
    LIBAIRSPYHF_INCLUDE_DIRS
    NAMES libairspyhf/airspyhf.h
    HINTS $ENV{LIBAIRSPY_DIR}/include
    	${PC_LIBAIRSPYHF_INCLUDEDIR}
    PATHS /usr/local/include
          /usr/include
)

FIND_LIBRARY(
    LIBAIRSPYHF_LIBRARIES
    NAMES airspyhf
    HINTS $ENV{LIBAIRSPYHF_DIR}/lib
    	${PC_LIBAIRSPYHF_LIBDIR}
    PATHS /usr/local/lib
          /usr/lib
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBAIRSPYHF DEFAULT_MSG LIBAIRSPYHF_LIBRARIES LIBAIRSPYHF_INCLUDE_DIRS)
MARK_AS_ADVANCED(LIBAIRSPYHF_LIBRARIES LIBAIRSPYHF_INCLUDE_DIRS)
