Warning, /frameworks/kcoreaddons/cmake/FindProcstat.cmake is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2019 Tobias C. Berner <tcberner@FreeBSD.org>
0002 #
0003 # SPDX-License-Identifier: BSD-2-Clause
0004 #[=======================================================================[.rst:
0005 FindProcstat
0006 -------
0007 
0008 Finds the procstat library.
0009 
0010 Imported Targets
0011 ^^^^^^^^^^^^^^^^
0012 
0013 This module provides the following imported targets, if found:
0014 
0015 ``Procstat::Procstat``
0016   The procstat library
0017 
0018 Result Variables
0019 ^^^^^^^^^^^^^^^^
0020 
0021 This will define the following variables:
0022 
0023 ``Procstat_FOUND``
0024   True if the system has the libprocstat library.
0025 ``Procstat_INCLUDE_DIRS``
0026   Include directories needed to use procstat.
0027 ``Procstat_LIBRARIES``
0028   Libraries needed to link to libprocstat.
0029 
0030 #]=======================================================================]
0031 
0032 
0033 find_path(Procstat_INCLUDE_DIRS libprocstat.h)
0034 
0035 find_library(Procstat_LIBRARIES NAMES procstat)
0036 
0037 include(FindPackageHandleStandardArgs)
0038 find_package_handle_standard_args(Procstat DEFAULT_MSG Procstat_INCLUDE_DIRS Procstat_LIBRARIES)
0039 
0040 set_package_properties(Procstat PROPERTIES
0041     URL "https://github.com/freebsd/freebsd/tree/master/lib/libprocstat"
0042     DESCRIPTION "Library to access process information"
0043 )
0044 mark_as_advanced(Procstat_INCLUDE_DIRS Procstat_LIBRARIES)
0045 if(Procstat_FOUND AND NOT TARGET Procstat::Procstat)
0046     add_library(Procstat::Procstat UNKNOWN IMPORTED)
0047     set_target_properties(Procstat::Procstat PROPERTIES
0048         IMPORTED_LOCATION "${Procstat_LIBRARIES}"
0049         INTERFACE_INCLUDE_DIRECTORIES "${Procstat_INCLUDE_DIRS}"
0050     )
0051 endif()
0052