summaryrefslogtreecommitdiff
path: root/cmake/FindNFNETLINK.cmake
diff options
context:
space:
mode:
author卢文朋 <[email protected]>2021-09-13 02:12:29 +0000
committerluwenpeng <[email protected]>2021-09-15 16:58:01 +0800
commitba21a53bb7c8bc5e70eae278b2fd238c2bcd1337 (patch)
treef15571a0b8c096532be99e8a6858370c047a4b86 /cmake/FindNFNETLINK.cmake
parentaa887fd382a4eb1b981280183a780649230d71e9 (diff)
TSG-7784 PacketAdapter支持CI自动构建RPM; 修改代码结构
Diffstat (limited to 'cmake/FindNFNETLINK.cmake')
-rw-r--r--cmake/FindNFNETLINK.cmake39
1 files changed, 39 insertions, 0 deletions
diff --git a/cmake/FindNFNETLINK.cmake b/cmake/FindNFNETLINK.cmake
new file mode 100644
index 0000000..e0e7742
--- /dev/null
+++ b/cmake/FindNFNETLINK.cmake
@@ -0,0 +1,39 @@
+# - Find nfnetlinkDaemon
+# Find the nfnetlink daemon library
+#
+# This module defines the following variables:
+# NFNETLINK_FOUND - True if library and include directory are found
+# If set to TRUE, the following are also defined:
+# NFNETLINK_INCLUDE_DIRS - The directory where to find the header file
+# NFNETLINK_LIBRARIES - Where to find the library file
+#
+# For conveniance, these variables are also set. They have the same values
+# than the variables above. The user can thus choose his/her prefered way
+# to write them.
+# NFNETLINK_LIBRARY
+# NFNETLINK_INCLUDE_DIR
+#
+# This file is in the public domain
+
+include(FindPkgConfig)
+pkg_check_modules(NFNETLINK libnfnetlink)
+
+if(NOT NFNETLINK_FOUND)
+ find_path(NFNETLINK_INCLUDE_DIRS NAMES nlibnfnetlink/libnfnetlink.h
+ DOC "The nfnetlink include directory")
+
+ find_library(NFNETLINK_LIBRARIES NAMES libnfnetlink
+ DOC "The nfnetlink library")
+
+ # Use some standard module to handle the QUIETLY and REQUIRED arguments, and
+ # set NFNETLINK_FOUND to TRUE if these two variables are set.
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(NFNETLINK REQUIRED_VARS NFNETLINK_LIBRARIES NFNETLINK_INCLUDE_DIRS)
+
+ if(NFNETLINK_FOUND)
+ set(NFNETLINK_LIBRARY ${NFNETLINK_LIBRARIES})
+ set(NFNETLINK_INCLUDE_DIR ${NFNETLINK_INCLUDE_DIRS})
+ endif()
+endif()
+
+mark_as_advanced(NFNETLINK_INCLUDE_DIRS NFNETLINK_LIBRARIES) \ No newline at end of file