summaryrefslogtreecommitdiff
path: root/src/FindReadline.cmake
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2009-01-31 19:39:48 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2009-01-31 19:39:48 +0100
commit516bc854369243b2f1ba4f1c019aca06cbbd736e (patch)
tree82cbc27a8975af41b694090172421e8dd83c9d92 /src/FindReadline.cmake
parent9312c14b47a2d6e58238902d1424ae8d45d73ac5 (diff)
downloadpianobar-516bc854369243b2f1ba4f1c019aca06cbbd736e.tar.gz
pianobar-516bc854369243b2f1ba4f1c019aca06cbbd736e.tar.bz2
pianobar-516bc854369243b2f1ba4f1c019aca06cbbd736e.zip
Whoops, forgot to add new files to last commit...
Diffstat (limited to 'src/FindReadline.cmake')
-rw-r--r--src/FindReadline.cmake37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/FindReadline.cmake b/src/FindReadline.cmake
new file mode 100644
index 0000000..67ea232
--- /dev/null
+++ b/src/FindReadline.cmake
@@ -0,0 +1,37 @@
+# - Find readline
+#
+# READLINE_INCLUDE_DIRS - where to find curl/curl.h, etc.
+# READLINE_LIBRARIES - List of libraries when using curl.
+# READLINE_FOUND - True if curl found.
+
+# Look for the header file.
+FIND_PATH(READLINE_INCLUDE_DIR NAMES readline/readline.h)
+MARK_AS_ADVANCED(READLINE_INCLUDE_DIR)
+
+# Look for the library.
+FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
+MARK_AS_ADVANCED(READLINE_LIBRARY)
+
+# Copy the results to the output variables.
+IF(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+ SET(READLINE_FOUND 1)
+ SET(READLINE_LIBRARIES ${READLINE_LIBRARY})
+ SET(READLINE_INCLUDE_DIRS ${READLINE_INCLUDE_DIR})
+ELSE(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+ SET(READLINE_FOUND 0)
+ SET(READLINE_LIBRARIES)
+ SET(READLINE_INCLUDE_DIRS)
+ENDIF(READLINE_INCLUDE_DIR AND READLINE_LIBRARY)
+
+# Report the results.
+IF(NOT READLINE_FOUND)
+ SET(READLINE_DIR_MESSAGE
+ "READLINE was not found. Make sure READLINE_LIBRARY and READLINE_INCLUDE_DIR are set.")
+ IF(NOT READLINE_FIND_QUIETLY)
+ MESSAGE(STATUS "${READLINE_DIR_MESSAGE}")
+ ELSE(NOT READLINE_FIND_QUIETLY)
+ IF(READLINE_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${READLINE_DIR_MESSAGE}")
+ ENDIF(READLINE_FIND_REQUIRED)
+ ENDIF(NOT READLINE_FIND_QUIETLY)
+ENDIF(NOT READLINE_FOUND)