summaryrefslogtreecommitdiffstats
path: root/FindCAP.cmake
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-12-24 17:14:40 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-12-24 17:14:40 +0100
commiteaac49427339a365aac2d3505f567572cfbdbb96 (patch)
treeb7a8d43aa24396d513747a9eb45d9e0fd29ce232 /FindCAP.cmake
parentcd8ab035e605c5d8f8105861b2818a54a21eb311 (diff)
downloadfastd-eaac49427339a365aac2d3505f567572cfbdbb96.tar
fastd-eaac49427339a365aac2d3505f567572cfbdbb96.zip
Add WITH_CAPABILITIES CMake flag and check for libcap
Diffstat (limited to 'FindCAP.cmake')
-rw-r--r--FindCAP.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/FindCAP.cmake b/FindCAP.cmake
new file mode 100644
index 0000000..80afff3
--- /dev/null
+++ b/FindCAP.cmake
@@ -0,0 +1,16 @@
+FIND_PATH(CAP_INCLUDE_DIR sys/capability.h)
+FIND_LIBRARY(CAP_LIBRARY NAMES cap)
+
+IF (CAP_INCLUDE_DIR AND CAP_LIBRARY)
+ SET(CAP_FOUND TRUE)
+ENDIF (CAP_INCLUDE_DIR AND CAP_LIBRARY)
+
+IF (CAP_FOUND)
+ IF (NOT CAP_FIND_QUIETLY)
+ MESSAGE(STATUS "Found libcap: ${CAP_LIBRARY}; include path: ${CAP_INCLUDE_DIR}")
+ ENDIF (NOT CAP_FIND_QUIETLY)
+ELSE (CAP_FOUND)
+ IF (CAP_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find libcap")
+ ENDIF (CAP_FIND_REQUIRED)
+ENDIF (CAP_FOUND)