From bd2a29ec7006e85cdda86665a9cafe71313935cf Mon Sep 17 00:00:00 2001 From: fryshorts Date: Sun, 3 May 2015 16:32:09 +0200 Subject: [PATCH] cmake: Add module to find libsysinfo on FreeBSD Add cmake module to find the sysinfo compatibility library used on FreeBSD to emulate that linux specific system call. --- cmake/Modules/FindLibsysinfo.cmake | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cmake/Modules/FindLibsysinfo.cmake diff --git a/cmake/Modules/FindLibsysinfo.cmake b/cmake/Modules/FindLibsysinfo.cmake new file mode 100644 index 000000000..b1b176e8c --- /dev/null +++ b/cmake/Modules/FindLibsysinfo.cmake @@ -0,0 +1,24 @@ +# Once done these will be defined: +# +# SYSINFO_FOUND +# SYSINFO_INCLUDE_DIRS +# SYSINFO_LIBRARIES + +find_path(SYSINFO_INCLUDE_DIR + NAMES sys/sysinfo.h + PATHS + /usr/include /usr/local/include /opt/local/include) + +find_library(SYSINFO_LIB + NAMES sysinfo libsysinfo + PATHS + /usr/lib /usr/local/lib /opt/local/lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(sysinfo DEFAULT_MSG SYSINFO_LIB SYSINFO_INCLUDE_DIR) +mark_as_advanced(SYSINFO_INCLUDE_DIR SYSINFO_LIB) + +if(SYSINFO_FOUND) + set(SYSINFO_INCLUDE_DIRS ${SYSINFO_INCLUDE_DIR}) + set(SYSINFO_LIBRARIES ${SYSINFO_LIB}) +endif()