diff options
| author | Kudlaty <none@none> | 2009-09-06 00:39:13 +0200 |
|---|---|---|
| committer | Kudlaty <none@none> | 2009-09-06 00:39:13 +0200 |
| commit | b6e694ab68de91c0ce03e98a35eafe29cb9e8b99 (patch) | |
| tree | 6460eabca6fad2e6b9a506a7d0a9cd3923400aff /cmake | |
| parent | 5e13c487fd8821035bbd1505e08718e6d82fd931 (diff) | |
Add macro for finding Termcap with cmake, and some cleaning about readline
--HG--
branch : trunk
Diffstat (limited to 'cmake')
| -rw-r--r-- | cmake/FindReadline.cmake | 27 | ||||
| -rw-r--r-- | cmake/FindTermcap.cmake | 33 |
2 files changed, 49 insertions, 11 deletions
diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake index 27ab8291fc0..41998e6c91e 100644 --- a/cmake/FindReadline.cmake +++ b/cmake/FindReadline.cmake @@ -1,18 +1,23 @@ +# find Readline (terminal input library) includes and library +# +# READLINE_INCLUDE_DIR - where the directory containing the READLINE headers can be found +# READLINE_LIBRARY - full path to the READLINE library +# READLINE_FOUND - TRUE if READLINE was found + MACRO(FIND_READLINE) -FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h) + +FIND_PATH(READLINE_INCLUDE_DIR radline/readline.h) FIND_LIBRARY(READLINE_LIBRARY NAMES readline) IF (READLINE_INCLUDE_DIR AND READLINE_LIBRARY) - SET(READLINE_FOUND TRUE) + SET(READLINE_FOUND TRUE) + MESSAGE(STATUS "Found Readline library: ${READLINE_LIBRARY}") + MESSAGE(STATUS "Include dir is: ${READLINE_INCLUDE_DIR}") + INCLUDE_DIRECTORIES(${READLINE_INCLUDE_DIR}) +ELSE (READLINE_INCLUDE_DIR AND READLINE_LIBRARY) + SET(READLINE_FOUND FALSE) + MESSAGE(FATAL_ERROR "** Readline library not found!") + MESSAGE(FATAL_ERROR "** Your distro may provide a binary for Readline e.g. for ubuntu try apt-get install libreadline5-dev") 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) ENDMACRO(FIND_READLINE) diff --git a/cmake/FindTermcap.cmake b/cmake/FindTermcap.cmake new file mode 100644 index 00000000000..b3780d3ed8d --- /dev/null +++ b/cmake/FindTermcap.cmake @@ -0,0 +1,33 @@ +# find Terrmcap (terminal input library) includes and library +# +# TERMCAP_INCLUDE_DIR - where the directory containing the TERMCAP headers can be found +# TERMCAP_LIBRARY - full path to the TERMCAP library +# TERMCAP_FOUND - TRUE if TERMCAP was found + +MACRO(FIND_TERMCAP) + +FIND_PATH(TERMCAP_INCLUDE_DIR termcap.h + /usr/include + /usr/local/include + + /opt/local/include +) + +FIND_LIBRARY(TERMCAP_LIBRARY NAMES termcap PATH + /usr/lib + /usr/local/lib + /opt/local/lib + /usr/lib64 +) + +IF (TERMCAP_INCLUDE_DIR AND TERMCAP_LIBRARY) + SET(TERMCAP_FOUND TRUE) + MESSAGE(STATUS "Found GNU termcap: ${TERMCAP_LIBRARY}") + MESSAGE(STATUS "Include dir is: ${TERMCAP_INCLUDE_DIR}") + INCLUDE_DIRECTORIES(${TERMCAP_INCLUDE_DIR}) +ELSE (TERMCAP_INCLUDE_DIR AND TERMCAP_LIBRARY) + SET(TERMCAP_FOUND FALSE) + MESSAGE(FATAL_ERROR "Could not find GNU termcap") +ENDIF (TERMCAP_INCLUDE_DIR AND TERMCAP_LIBRARY) + +ENDMACRO(FIND_TERMCAP) |
