Warning, /frameworks/extra-cmake-modules/find-modules/FindSeccomp.cmake is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
0002 # SPDX-FileCopyrightText: 2017 David Kahles <david.kahles96@gmail.com>
0003 #
0004 # SPDX-License-Identifier: BSD-3-Clause
0005 
0006 #[=======================================================================[.rst:
0007 FindSeccomp
0008 -----------
0009 
0010 Try to locate the libseccomp library.
0011 
0012 This will define the following variables:
0013 
0014 ``Seccomp_FOUND``
0015     True if the seccomp library is available
0016 ``Seccomp_INCLUDE_DIRS``
0017     The seccomp include directories
0018 ``Seccomp_LIBRARIES``
0019     The seccomp libraries for linking
0020 
0021 If ``Seccomp_FOUND`` is TRUE, it will also define the following
0022 imported target:
0023 
0024 ``Seccomp::Seccomp``
0025     The Seccomp library
0026 
0027 Since 5.44.0.
0028 #]=======================================================================]
0029 
0030 find_package(PkgConfig QUIET)
0031 pkg_check_modules(PKG_Libseccomp QUIET libseccomp)
0032 
0033 find_path(Seccomp_INCLUDE_DIRS
0034     NAMES
0035         seccomp.h
0036     HINTS
0037         ${PKG_Libseccomp_INCLUDE_DIRS}
0038 )
0039 find_library(Seccomp_LIBRARIES
0040     NAMES
0041         seccomp
0042     HINTS
0043         ${PKG_Libseccomp_LIBRARY_DIRS}
0044 )
0045 
0046 include(FindPackageHandleStandardArgs)
0047 find_package_handle_standard_args(Seccomp
0048     FOUND_VAR
0049         Seccomp_FOUND
0050     REQUIRED_VARS
0051         Seccomp_LIBRARIES
0052         Seccomp_INCLUDE_DIRS
0053 )
0054 
0055 if (Seccomp_FOUND AND NOT TARGET Seccomp::Seccomp)
0056     add_library(Seccomp::Seccomp UNKNOWN IMPORTED)
0057     set_target_properties(Seccomp::Seccomp PROPERTIES
0058         IMPORTED_LOCATION "${Seccomp_LIBRARIES}"
0059         INTERFACE_INCLUDE_DIRECTORIES "${Seccomp_INCLUDE_DIRS}"
0060     )
0061 endif()
0062 
0063 mark_as_advanced(Seccomp_LIBRARIES Seccomp_INCLUDE_DIRS)
0064 
0065 include(FeatureSummary)
0066 set_package_properties(Seccomp PROPERTIES
0067     URL "https://github.com/seccomp/libseccomp"
0068     DESCRIPTION "The enhanced seccomp library."
0069 )