aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindLibUV.cmake
diff options
context:
space:
mode:
authorRich Wareham <rjw57@cam.ac.uk>2014-02-24 20:57:04 +0000
committerThiago de Arruda <tpadilha84@gmail.com>2014-02-26 07:08:44 -0300
commit00ca93fb5037173897f2055a8dc9af143c031931 (patch)
treea794ef63e3ce3b0114dfa63c55c0edb1334bc2d7 /cmake/FindLibUV.cmake
parent8aa1d8c71a0437ff09872877107dab30ee0c44f0 (diff)
downloadrneovim-00ca93fb5037173897f2055a8dc9af143c031931.tar.gz
rneovim-00ca93fb5037173897f2055a8dc9af143c031931.tar.bz2
rneovim-00ca93fb5037173897f2055a8dc9af143c031931.zip
automatically discover libuv in CMake
Idiomatically discover if libuv is installed.
Diffstat (limited to 'cmake/FindLibUV.cmake')
-rw-r--r--cmake/FindLibUV.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/FindLibUV.cmake b/cmake/FindLibUV.cmake
new file mode 100644
index 0000000000..3aeb01195e
--- /dev/null
+++ b/cmake/FindLibUV.cmake
@@ -0,0 +1,24 @@
+# - Try to find libuv
+# Once done, this will define
+#
+# LibUV_FOUND - system has libuv
+# LibUV_INCLUDE_DIRS - the libuv include directories
+# LibUV_LIBRARIES - link these to use libuv
+
+include(LibFindMacros)
+
+# Include dir
+find_path(LibUV_INCLUDE_DIR
+ NAMES uv.h
+)
+
+# The library itself
+find_library(LibUV_LIBRARY
+ NAMES uv
+)
+
+# Set the include dir variables and the libraries and let libfind_process do the rest.
+# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
+set(LibUV_PROCESS_INCLUDES LibUV_INCLUDE_DIR)
+set(LibUV_PROCESS_LIBS LibUV_LIBRARY)
+libfind_process(LibUV)