summaryrefslogtreecommitdiff
path: root/cmake/FindReadline.cmake
diff options
context:
space:
mode:
authorIvo De Decker <ivodd@debian.org>2014-12-06 18:58:19 +0000
committerIvo De Decker <ivodd@debian.org>2014-12-06 18:58:19 +0000
commitdd986e8b547c0dde924c4b566ad0894ad4f1beb9 (patch)
treea87ee49df2a732f2be8d1b3c9e46a341e6fb8698 /cmake/FindReadline.cmake
pcre3 (2:8.35-3.3) unstable; urgency=medium
* Non-maintainer upload. * Upstream patch for heap buffer overflow, CVE-2014-8964, taken from 1:8.36-1 (Closes: #770478) Thanks to Salvatore Bonaccorso for the reminder. # imported from the archive
Diffstat (limited to 'cmake/FindReadline.cmake')
-rw-r--r--cmake/FindReadline.cmake29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake
new file mode 100644
index 0000000..1d4cc55
--- /dev/null
+++ b/cmake/FindReadline.cmake
@@ -0,0 +1,29 @@
+# from http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/FindReadline.cmake
+# http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/COPYING-CMAKE-SCRIPTS
+# --> BSD licensed
+#
+# GNU Readline library finder
+if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
+ set(READLINE_FOUND TRUE)
+else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
+ FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h
+ /usr/include/readline
+ )
+
+# 2008-04-22 The next clause used to read like this:
+#
+# FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
+# FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses )
+# include(FindPackageHandleStandardArgs)
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY )
+#
+# I was advised to modify it such that it will find an ncurses library if
+# required, but not if one was explicitly given, that is, it allows the
+# default to be overridden. PH
+
+ FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
+ include(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY )
+
+ MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
+endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)