# - Try to find loonlib
# Once done this will define
# LOONLIB_FOUND - System has loonlib
# LOONLIB_INCLUDE_DIRS - The loonlib include directories
# LOONLIB_LIBRARIES - The libraries need to use loonlib

find_path(LOONLIB_INCLUDE_DIR loonutil/util.h HINTS ${LOONLIB_ROOT_DIR}/include)

find_library(LOONLIB_LOONUTIL_LIBRARY NAMES loonutil HINTS ${LOONLIB_ROOT_DIR}/lib)
find_library(LOONLIB_LOONPRIVATE_LIBRARY NAMES loonprivate HINTS ${LOONLIB_ROOT_DIR}/lib)
find_library(LOONLIB_LOONTHREAD_LIBRARY NAMES loonthread HINTS ${LOONLIB_ROOT_DIR}/lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(loonlib DEFAULT_MSG LOONLIB_INCLUDE_DIR LOONLIB_LOONUTIL_LIBRARY LOONLIB_LOONPRIVATE_LIBRARY LOONLIB_LOONTHREAD_LIBRARY)
mark_as_advanced(LOONLIB_INCLUDE_DIR LOONLIB_LOONUTIL_LIBRARY LOONLIB_LOONPRIVATE_LIBRARY LOONLIB_LOONTHREAD_LIBRARY)

set(LOONLIB_INCLUDE_DIRS ${LOONLIB_INCLUDE_DIR})
set(LOONLIB_LIBRARIES ${LOONLIB_LOONPRIVATE_LIBRARY} ${LOONLIB_LOONUTIL_LIBRARY} ${LOONLIB_LOONTHREAD_LIBRARY})


