2015-09-21 15:08:19 +00:00
|
|
|
# Try to find Keyutils
|
|
|
|
# Once done, this will define
|
|
|
|
#
|
2016-05-13 14:02:34 +00:00
|
|
|
# KEYUTILS_FOUND - system has keyutils
|
|
|
|
# KEYUTILS_INCLUDE_DIR - the keyutils include directories
|
|
|
|
# KEYUTILS_LIBRARIES - link these to use keyutils
|
2015-09-21 15:08:19 +00:00
|
|
|
|
2017-01-01 22:38:59 +00:00
|
|
|
find_path(KEYUTILS_INCLUDE_DIR keyutils.h PATHS
|
2015-09-21 15:08:19 +00:00
|
|
|
/opt/local/include
|
|
|
|
/usr/local/include
|
|
|
|
)
|
|
|
|
|
2018-07-27 17:51:20 +00:00
|
|
|
find_library(KEYUTILS_LIBRARIES NAMES keyutils)
|
2015-09-21 15:08:19 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2018-07-27 17:51:20 +00:00
|
|
|
find_package_handle_standard_args(keyutils
|
|
|
|
DEFAULT_MSG KEYUTILS_LIBRARIES KEYUTILS_INCLUDE_DIR)
|
2015-09-21 15:08:19 +00:00
|
|
|
|
|
|
|
mark_as_advanced(KEYUTILS_LIBRARIES KEYUTILS_INCLUDE_DIR)
|
2018-07-27 17:51:20 +00:00
|
|
|
|
|
|
|
if(KEYUTILS_FOUND AND NOT (TARGET keyutils::keyutils))
|
|
|
|
add_library(keyutils::keyutils UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(keyutils::keyutils PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${KEYUTILS_INCLUDE_DIR}"
|
|
|
|
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
|
|
|
IMPORTED_LOCATION "${KEYUTILS_LIBRARIES}")
|
|
|
|
endif()
|