aboutsummaryrefslogtreecommitdiff
path: root/drive-sdk/cmake/modules/FindReadline.cmake
diff options
context:
space:
mode:
authorDimitri Sokolyuk <ds@doozer.de>2016-12-05 11:22:26 +0100
committerDimitri Sokolyuk <ds@doozer.de>2016-12-05 11:22:26 +0100
commit3c89fd52679c8ccebceb30294a4bd815b51ede19 (patch)
tree8fc9fb1763af5b0d6f5d5e76e0eb688c1771e9e5 /drive-sdk/cmake/modules/FindReadline.cmake
parent58cf0a5b526a5afe6c8ee956aa32455dcf243586 (diff)
Import Drive SDK
Diffstat (limited to 'drive-sdk/cmake/modules/FindReadline.cmake')
-rw-r--r--drive-sdk/cmake/modules/FindReadline.cmake35
1 files changed, 35 insertions, 0 deletions
diff --git a/drive-sdk/cmake/modules/FindReadline.cmake b/drive-sdk/cmake/modules/FindReadline.cmake
new file mode 100644
index 0000000..7d1601f
--- /dev/null
+++ b/drive-sdk/cmake/modules/FindReadline.cmake
@@ -0,0 +1,35 @@
+# Try to find Readline library and header.
+# This file sets the following variables:
+#
+# READLINE_INCLUDE_DIR, where to find readline.h, etc.
+# READLINE_LIBRARIES, the libraries to link against
+# READLINE_FOUND, If false, do not try to use Readline.
+#
+# Also defined, but not for general use are:
+# READLINE_LIBRARY, the full path to the Readline library.
+# READLINE_INCLUDE_PATH, for CMake backward compatibility
+
+FIND_PATH(READLINE_INCLUDE_DIR readline.h
+ PATHS /usr/local/include
+ /usr/include
+ PATH_SUFFIXES readline
+)
+
+FIND_LIBRARY(READLINE_LIBRARY readline
+ /usr/lib
+ /usr/local/lib
+)
+
+# handle the QUIETLY and REQUIRED arguments and set READLINE_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(READLINE DEFAULT_MSG READLINE_LIBRARY READLINE_INCLUDE_DIR)
+
+IF(READLINE_FOUND)
+ SET(READLINE_LIBRARIES ${READLINE_LIBRARY})
+ENDIF(READLINE_FOUND)
+
+MARK_AS_ADVANCED(
+ READLINE_INCLUDE_DIR
+ READLINE_LIBRARY
+)