1# from http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/FindReadline.cmake
2# http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/COPYING-CMAKE-SCRIPTS
3# --> BSD licensed
4#
5# GNU Readline library finder
6if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
7  set(READLINE_FOUND TRUE)
8else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
9  FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h
10    /usr/include/readline
11  )
12  
13# 2008-04-22 The next clause used to read like this:
14#
15#  FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
16#        FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses )
17#        include(FindPackageHandleStandardArgs)
18#        FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY )
19#
20# I was advised to modify it such that it will find an ncurses library if
21# required, but not if one was explicitly given, that is, it allows the
22# default to be overridden. PH 
23
24  FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
25        include(FindPackageHandleStandardArgs)
26        FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY )
27
28  MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
29endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
30