1 # - Find the readline library
3 # READLINE_INCLUDE_DIR, path to readline/readline.h, etc.
4 # READLINE_LIBRARIES, the libraries required to use READLINE.
5 # READLINE_FOUND, If false, do not try to use READLINE.
6 # also defined, but not for general use are
7 # READLINE_readline_LIBRARY, where to find the READLINE library.
8 # READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined]
10 # Apple readline does not support readline hooks
11 # So we look for another one by default
13 FIND_PATH (READLINE_INCLUDE_DIR NAMES readline/readline.h PATHS
21 ENDIF (APPLE OR FREEBSD)
22 FIND_PATH (READLINE_INCLUDE_DIR NAMES readline/readline.h)
25 # Apple readline does not support readline hooks
26 # So we look for another one by default
28 FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline PATHS
36 ENDIF (APPLE OR FREEBSD)
37 FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline)
39 # Sometimes readline really needs ncurses
41 FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses PATHS
50 ENDIF (APPLE OR FREEBSD)
51 FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses)
55 READLINE_readline_LIBRARY
56 READLINE_ncurses_LIBRARY
59 SET (READLINE_FOUND "NO" )
60 IF (READLINE_INCLUDE_DIR)
61 IF (READLINE_readline_LIBRARY)
62 SET (READLINE_FOUND "YES" )
63 SET (READLINE_LIBRARIES
64 ${READLINE_readline_LIBRARY}
67 # some readline libraries depend on ncurses
68 IF (READLINE_ncurses_LIBRARY)
69 SET (READLINE_LIBRARIES ${READLINE_LIBRARIES} ${READLINE_ncurses_LIBRARY})
70 ENDIF (READLINE_ncurses_LIBRARY)
72 ENDIF (READLINE_readline_LIBRARY)
73 ENDIF (READLINE_INCLUDE_DIR)
76 MESSAGE (STATUS "Found readline library")
78 IF (READLINE_FIND_REQUIRED)
79 MESSAGE (FATAL_ERROR "Could not find readline -- please give some paths to CMake")
80 ENDIF (READLINE_FIND_REQUIRED)
81 ENDIF (READLINE_FOUND)