@PACKAGE_INIT@

INCLUDE(GNUInstallDirs)

SET(LIB_RING_CLIENT_INCLUDE_DIR @INCLUDE_INSTALL_DIR@/libringclient)

STRING(REPLACE "${CMAKE_LIBRARY_ARCHITECTURE}" "" SANE_LIBRARY_PATH "${CMAKE_INSTALL_FULL_LIBDIR}" )

# First, always set the dynamic path
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so;.dll")
SET(LIB_RING_CLIENT_LIBRARY_NAME "ringclient")

FIND_LIBRARY(LIB_RING_CLIENT_LIBRARY_DYNAMIC NAMES ringclient
            PATHS ${RING_BUILD_DIR}/.libs
            PATHS @LIB_INSTALL_DIR@
            PATHS ${CMAKE_INSTALL_PREFIX}/libexec )

#if ENABLE_STATIC is set, default to the static version
IF(DEFINED ${ENABLE_STATIC} OR ${ENABLE_STATIC} MATCHES true)
   SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.la;.lib")
   SET(LIB_RING_CLIENT_LIBRARY_NAME "ringclient_static")

   FIND_LIBRARY(LIB_RING_CLIENT_LIBRARY_STATIC NAMES ringclient_static
             PATHS ${RING_BUILD_DIR}/.libs
             PATHS @LIB_INSTALL_DIR@
             PATHS ${CMAKE_INSTALL_PREFIX}/libexec )
ENDIF()


FIND_LIBRARY(LIB_RING_CLIENT_LIBRARY NAMES ${LIB_RING_CLIENT_LIBRARY_NAME}
             PATHS ${RING_BUILD_DIR}/.libs
             PATHS @LIB_INSTALL_DIR@
             PATHS ${CMAKE_INSTALL_PREFIX}/libexec )


# Set the usual CMake library variables. This is required for some other official
# cmake macros to work
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIB_RING_CLIENT
    FOUND_VAR
        LIB_RING_CLIENT_FOUND
    REQUIRED_VARS
        LIB_RING_CLIENT_LIBRARY
        LIB_RING_CLIENT_INCLUDE_DIR
    VERSION_VAR
        @GENERIC_LIB_VERSION@
)
