1 # Check supported methods to gather system statistics
3 if(EXISTS "/proc/loadavg" AND EXISTS "/proc/meminfo")
5 add_definitions(-DHAVE_PROC_STAT=1)
6 message(STATUS "System supports procfs statistics")
10 include(CheckCSourceRuns)
12 SET(CMAKE_REQUIRED_DEFINITIONS -Werror-implicit-function-declaration)
14 check_c_source_runs("#include <stdio.h>
15 #include <sys/types.h>
16 #include <sys/sysctl.h>
17 #include <sys/resource.h>
21 size_t sz = sizeof(la);
22 return sysctlbyname(\"vm.loadavg\", &la, &sz, NULL, 0);
24 unset(CMAKE_REQUIRED_DEFINITIONS)
26 add_definitions(-DHAVE_SYSCTL_STAT=1)
27 message(STATUS "System supports sysctl statistics")