summaryrefslogtreecommitdiffstats
path: root/FindReadline.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'FindReadline.cmake')
-rw-r--r--FindReadline.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/FindReadline.cmake b/FindReadline.cmake
new file mode 100644
index 0000000..74dc302
--- /dev/null
+++ b/FindReadline.cmake
@@ -0,0 +1,17 @@
+FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h)
+FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
+
+IF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+ SET(READLINE_FOUND TRUE)
+ENDIF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+
+IF (READLINE_FOUND)
+ IF (NOT Readline_FIND_QUIETLY)
+ MESSAGE(STATUS "Found GNU readline: ${READLINE_LIBRARY}")
+ ENDIF (NOT Readline_FIND_QUIETLY)
+ELSE (READLINE_FOUND)
+ IF (Readline_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find GNU readline")
+ ENDIF (Readline_FIND_REQUIRED)
+ENDIF (READLINE_FOUND)
+