summaryrefslogtreecommitdiff
path: root/cmake/dependencies/systemlibraries.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/dependencies/systemlibraries.cmake')
-rw-r--r--cmake/dependencies/systemlibraries.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/dependencies/systemlibraries.cmake b/cmake/dependencies/systemlibraries.cmake
new file mode 100644
index 00000000..e00266d6
--- /dev/null
+++ b/cmake/dependencies/systemlibraries.cmake
@@ -0,0 +1,20 @@
+if (NOT APPLE)
+ find_library(LIBRT_LIBRARIES rt)
+ if (NOT LIBRT_LIBRARIES)
+ message(FATAL_ERROR "Could not find librt")
+ endif ()
+else ()
+ set(LIBRT_LIBRARIES "")
+endif ()
+
+find_library(LIBPTHREAD_LIBRARIES pthread)
+if (NOT LIBPTHREAD_LIBRARIES)
+ message(FATAL_ERROR "Could not find libpthread")
+endif ()
+
+find_library(LIBM_LIBRARIES m)
+if (NOT LIBM_LIBRARIES)
+ message(FATAL_ERROR "Could not find libm")
+endif ()
+
+mark_as_advanced(LIBRT_LIBRARIES LIBPTHREAD_LIBRARIES LIBM_LIBRARIES)