This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/cmake/readline.cmake

59 lines
2.0 KiB
CMake
Raw Permalink Normal View History

2017-10-12 12:08:32 +01:00
## after we have all functionality in
#
# ADD_SUBDIRECTORY(console/terminal)
option (WITH_READLINE "GNU readline console" ON)
2017-10-17 00:13:09 +01:00
2017-10-12 12:08:32 +01:00
if (WITH_READLINE)
2017-11-10 23:08:35 +00:00
find_library(READLINE_tinfo_LIBRARY
NAMES tinfo
message(STATUS "tinfo DLL found at ${READLINE_tinfo_LIBRARY}")
2018-02-10 14:12:29 +00:00
HINTS ${READLINE_ROOT_DIR}/lib
2017-11-10 23:08:35 +00:00
)
find_library(READLINE_tinfow_LIBRARY
NAMES tinfow
2018-02-10 14:12:29 +00:00
HINTS ${READLINE_ROOT_DIR}/lib
2017-11-10 23:08:35 +00:00
)
find_library(READLINE_ncurses_LIBRARY
essage(STATUS "tinfo DLL found at ${READLINE_tinfo_LIBRARY}")
2018-02-10 14:12:29 +00:00
HINTS ${READLINE_ROOT_DIR}/lib
2017-11-10 23:08:35 +00:00
)
find_library(READLINE_tinfow_LIBRARY
NAMES tinfow
2018-02-10 14:12:29 +00:00
HINTS ${READLINE_ROOT_DIR}/lib
2017-11-10 23:08:35 +00:00
)
2017-10-17 00:13:09 +01:00
find_library(READLINE_ncurses_LIBRARY
NAMES ncurses
2018-02-10 14:12:29 +00:00
HINTS ${READLINE_ROOT_DIR}/lib
2017-11-10 23:08:35 +00:00
message(STATUS "readline ncurses DLL found at ${READLINE_ncurses_LIBRARY}")
2017-10-17 00:13:09 +01:00
)
2017-11-10 23:08:35 +00:00
find_library(READLINE_ncursesw_LIBRARY
NAMES ncursesw
message(STATUS "readline ncursesw DLL found at ${READLINE_ncursesw_LIBRARY}")
2018-02-10 14:12:29 +00:00
HINTS ${READLINE_ROOT_DIR}/lib
2017-11-10 23:08:35 +00:00
)
2017-10-17 00:13:09 +01:00
find_path(READLINE_INCLUDE_DIR
NAMES readline/readline.h
2018-02-10 14:12:29 +00:00
HINTS ${READLINE_ROOT_DIR}/include
2017-10-17 00:13:09 +01:00
)
find_library(READLINE_readline_LIBRARY
NAMES readline
2018-02-10 14:12:29 +00:00
HINTS ${READLINE_INCLUDE_DIR/../lib} ${READLINE_ROOT_DIR}/lib
2017-10-17 00:13:09 +01:00
if (READLINE_readline_LIBRARY)
set (HAVE_LIBREADLINE TRUE)
if (READLINE_INCLUDE_DIR)
set(READLINE_FOUND TRUE CACHE BOOL "readline is installed correctly")
2017-11-10 23:08:35 +00:00
set (READLINE_LIBRARIES ${READLINE_ncursesw_LIBRARY} ${READLINE_tinfow_LIBRARY}$ ${READLINE_tinfo_LIBRARY}$ ${READLINE_ncurses_LIBRARY} ${READLINE_readline_LIBRARY} )
2017-10-17 00:13:09 +01:00
endif()
2017-11-10 23:08:35 +00:00
message(STATUS "headers found so far at ${READLINE_INCLUDE_DIR}")
message(STATUS "libraries found so far at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ${READLINE_tinfo_LIBRARY} ${READLINE_tinfow_LIBRARY} ${READLINE_ncursesw_LIBRARY} ")
else
2017-10-17 00:13:09 +01:00
endif ()
set(YAP_SYSTEM_OPTIONS "readline" ${YAP_SYSTEM_OPTIONS} )
set(EXTRALIBS ${EXTRALIBS} readline)
endif ()