File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ # Try to find libcap
2+ #
3+ find_package (PkgConfig QUIET REQUIRED)
4+
5+ pkg_check_modules(PC_cap QUIET cap)
6+
7+ find_library (cap_LIBRARY
8+ NAMES cap
9+ HINTS
10+ ${PC_cap_LIBDIR}
11+ ${PC_cap_LIBRARY_DIRS} )
12+
13+ find_path (cap_INCLUDE_DIR
14+ NAMES sys/capability.h
15+ HINTS
16+ ${PC_cap_INCLUDEDIR}
17+ ${PC_cap_INCLUDE_DIRS} )
18+
19+ mark_as_advanced (
20+ cap_LIBRARY
21+ cap_INCLUDE_DIR)
22+
23+ include (FindPackageHandleStandardArgs)
24+ find_package_handle_standard_args (cap
25+ REQUIRED_VARS
26+ cap_LIBRARY
27+ cap_INCLUDE_DIR)
28+
29+ if (cap_FOUND AND NOT TARGET cap::cap)
30+ add_library (cap::cap UNKNOWN IMPORTED )
31+ set_target_properties (cap::cap
32+ PROPERTIES
33+ IMPORTED_LOCATION ${cap_LIBRARY}
34+ INTERFACE_INCLUDE_DIRECTORIES ${cap_INCLUDE_DIR} )
35+ endif ()
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ add_subdirectory(vdo)
77add_library (extblkdev STATIC ExtBlkDevPlugin.cc)
88
99if (NOT WIN32 )
10+ find_package (cap)
1011target_link_libraries (extblkdev cap)
1112endif ()
1213
You can’t perform that action at this time.
0 commit comments