summaryrefslogtreecommitdiff
path: root/cmake/Findprocps.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Findprocps.cmake')
-rw-r--r--cmake/Findprocps.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/Findprocps.cmake b/cmake/Findprocps.cmake
new file mode 100644
index 00000000..dbf109b0
--- /dev/null
+++ b/cmake/Findprocps.cmake
@@ -0,0 +1,23 @@
+# - try to find procps directories and libraries
+#
+# Once done this will define:
+#
+# procps_FOUND
+# procps_INCLUDE_DIR
+# procps_LIBRARY
+#
+
+include (FindPackageMessage)
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ find_path (procps_INCLUDE_DIR proc/readproc.h)
+ find_library (procps_LIBRARY NAMES proc procps)
+ if (procps_INCLUDE_DIR AND procps_LIBRARY)
+ set (procps_FOUND 1)
+ mark_as_advanced (procps_FOUND)
+ find_package_message (procps "Found procps" "[${procps_LIBRARY}][${procps_INCLUDE_DIR}]")
+ else ()
+ find_package_message (procps "procps not found" "[${procps_LIBRARY}][${procps_INCLUDE_DIR}]")
+ endif ()
+endif()
+