INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_JAY jay)

FIND_PATH(
    JAY_INCLUDE_DIRS
    NAMES jay/api.h
    HINTS $ENV{JAY_DIR}/include
        ${PC_JAY_INCLUDEDIR}
    PATHS ${CMAKE_INSTALL_PREFIX}/include
          /usr/local/include
          /usr/include
)

FIND_LIBRARY(
    JAY_LIBRARIES
    NAMES gnuradio-jay
    HINTS $ENV{JAY_DIR}/lib
        ${PC_JAY_LIBDIR}
    PATHS ${CMAKE_INSTALL_PREFIX}/lib
          ${CMAKE_INSTALL_PREFIX}/lib64
          /usr/local/lib
          /usr/local/lib64
          /usr/lib
          /usr/lib64
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JAY DEFAULT_MSG JAY_LIBRARIES JAY_INCLUDE_DIRS)
MARK_AS_ADVANCED(JAY_LIBRARIES JAY_INCLUDE_DIRS)

