Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
53 lines
1.5 KiB
CMake
53 lines
1.5 KiB
CMake
# SPDX-FileCopyrightText: 2019 Tobias C. Berner <tcberner@FreeBSD.org>
|
|
#
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
#[=======================================================================[.rst:
|
|
FindProcstat
|
|
-------
|
|
|
|
Finds the procstat library.
|
|
|
|
Imported Targets
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
This module provides the following imported targets, if found:
|
|
|
|
``Procstat::Procstat``
|
|
The procstat library
|
|
|
|
Result Variables
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
This will define the following variables:
|
|
|
|
``Procstat_FOUND``
|
|
True if the system has the libprocstat library.
|
|
``Procstat_INCLUDE_DIRS``
|
|
Include directories needed to use procstat.
|
|
``Procstat_LIBRARIES``
|
|
Libraries needed to link to libprocstat.
|
|
|
|
#]=======================================================================]
|
|
|
|
|
|
find_path(Procstat_INCLUDE_DIRS libprocstat.h)
|
|
|
|
find_library(Procstat_LIBRARIES NAMES procstat)
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(Procstat DEFAULT_MSG Procstat_INCLUDE_DIRS Procstat_LIBRARIES)
|
|
|
|
set_package_properties(Procstat PROPERTIES
|
|
URL "https://github.com/freebsd/freebsd/tree/master/lib/libprocstat"
|
|
DESCRIPTION "Library to access process information"
|
|
)
|
|
mark_as_advanced(Procstat_INCLUDE_DIRS Procstat_LIBRARIES)
|
|
if(Procstat_FOUND AND NOT TARGET Procstat::Procstat)
|
|
add_library(Procstat::Procstat UNKNOWN IMPORTED)
|
|
set_target_properties(Procstat::Procstat PROPERTIES
|
|
IMPORTED_LOCATION "${Procstat_LIBRARIES}"
|
|
INTERFACE_INCLUDE_DIRECTORIES "${Procstat_INCLUDE_DIRS}"
|
|
)
|
|
endif()
|
|
|