Blame cmake/FindProcps.cmake

Packit 517ee8
# - Try to find PROCPS
Packit 517ee8
# Once done, this will define
Packit 517ee8
#
Packit 517ee8
#  PROCPS_FOUND - system has PROCPS
Packit 517ee8
#  PROCPS_INCLUDE_DIRS - the PROCPS include directories
Packit 517ee8
#  PROCPS_LIBRARIES - link these to use PROCPS
Packit 517ee8
Packit 517ee8
include(LibFindMacros)
Packit 517ee8
Packit 517ee8
# Use pkg-config to get hints about paths
Packit 517ee8
libfind_pkg_check_modules(PROCPS_PKGCONF libprocps)
Packit 517ee8
Packit 517ee8
# Include dir
Packit 517ee8
find_path(PROCPS_INCLUDE_DIR
Packit 517ee8
	NAMES proc/procps.h
Packit 517ee8
	PATHS ${PROCPS_PKGCONF_INCLUDE_DIRS}
Packit 517ee8
)
Packit 517ee8
Packit 517ee8
# Finally the library itself
Packit 517ee8
find_library(PROCPS_LIBRARY
Packit 517ee8
	NAMES procps
Packit 517ee8
	PATHS ${PROCPS_PKGCONF_LIBRARY_DIRS}
Packit 517ee8
)
Packit 517ee8
Packit 517ee8
# Set the include dir variables and the libraries and let libfind_process do the rest.
Packit 517ee8
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
Packit 517ee8
set(PROCPS_PROCESS_INCLUDES PROCPS_INCLUDE_DIR)
Packit 517ee8
set(PROCPS_PROCESS_LIBS PROCPS_LIBRARY)
Packit 517ee8
libfind_process(PROCPS)