2018-01-13 19:04:19 +01:00
|
|
|
# Exports:
|
2018-04-18 16:20:12 +02:00
|
|
|
#
|
|
|
|
# Variables:
|
2018-01-13 19:04:19 +01:00
|
|
|
# LIBUNICORN_FOUND
|
|
|
|
# LIBUNICORN_INCLUDE_DIR
|
|
|
|
# LIBUNICORN_LIBRARY
|
2018-04-18 16:20:12 +02:00
|
|
|
#
|
|
|
|
# Target:
|
|
|
|
# Unicorn::Unicorn
|
|
|
|
#
|
2018-01-13 19:04:19 +01:00
|
|
|
|
|
|
|
find_path(LIBUNICORN_INCLUDE_DIR
|
|
|
|
unicorn/unicorn.h
|
|
|
|
HINTS $ENV{UNICORNDIR}
|
|
|
|
PATH_SUFFIXES include)
|
|
|
|
|
|
|
|
find_library(LIBUNICORN_LIBRARY
|
|
|
|
NAMES unicorn
|
|
|
|
HINTS $ENV{UNICORNDIR})
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2020-06-27 11:06:39 +02:00
|
|
|
find_package_handle_standard_args(Unicorn DEFAULT_MSG LIBUNICORN_LIBRARY LIBUNICORN_INCLUDE_DIR)
|
2018-04-18 16:20:12 +02:00
|
|
|
|
|
|
|
if (UNICORN_FOUND)
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
unset(THREADS_PREFER_PTHREAD_FLAG)
|
|
|
|
|
|
|
|
add_library(Unicorn::Unicorn UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(Unicorn::Unicorn PROPERTIES
|
|
|
|
IMPORTED_LOCATION ${LIBUNICORN_LIBRARY}
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES ${LIBUNICORN_INCLUDE_DIR}
|
|
|
|
INTERFACE_LINK_LIBRARIES Threads::Threads
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-01-13 19:04:19 +01:00
|
|
|
mark_as_advanced(LIBUNICORN_INCLUDE_DIR LIBUNICORN_LIBRARY)
|