2023-02-03 12:31:39 -06:00
|
|
|
# Try to find LIBELF
|
|
|
|
|
#
|
|
|
|
|
# Once found, this will define:
|
|
|
|
|
# - LIBELF_FOUND - system has libelf
|
|
|
|
|
# - LIBELF_INCLUDE_DIRS - the libelf include directory
|
|
|
|
|
# - LIBELF_LIBRARIES - Link these to use libelf
|
|
|
|
|
# - LIBELF_DEFINITIONS - Compiler switches required for using libelf
|
2023-07-13 19:48:38 +00:00
|
|
|
find_path(
|
|
|
|
|
FIND_LIBELF_INCLUDES
|
|
|
|
|
NAMES libelf.h
|
|
|
|
|
PATHS /usr/include /usr/include/libelf /usr/local/include /usr/local/include/libelf)
|
2023-02-03 12:31:39 -06:00
|
|
|
|
2023-07-13 19:48:38 +00:00
|
|
|
find_library(FIND_LIBELF_LIBRARIES NAMES elf PATH /usr/lib /usr/local/lib)
|
2023-02-03 12:31:39 -06:00
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2023-07-13 19:48:38 +00:00
|
|
|
find_package_handle_standard_args(LibElf DEFAULT_MSG FIND_LIBELF_INCLUDES
|
|
|
|
|
FIND_LIBELF_LIBRARIES)
|
2023-02-03 12:31:39 -06:00
|
|
|
mark_as_advanced(FIND_LIBELF_INCLUDES FIND_LIBELF_LIBRARIES)
|
|
|
|
|
|
|
|
|
|
set(LIBELF_INCLUDES ${FIND_LIBELF_INCLUDES})
|
|
|
|
|
set(LIBELF_LIBRARIES ${FIND_LIBELF_LIBRARIES})
|