2013-08-22 02:56:07 +08:00
|
|
|
# - Find the curses include file and library
|
|
|
|
#
|
|
|
|
# CURSES_INCLUDE_DIR - the Curses include directory
|
|
|
|
# CURSES_LIBRARIES - The libraries needed to use Curses
|
2013-08-23 04:57:34 +08:00
|
|
|
# CURSES_HAVE_WIDE_CHAR - true if wide char is available
|
|
|
|
# NO_WIDECHAR - Input variable, if set, disable wide char
|
|
|
|
# ------------------------------------------------------------------------
|
2013-08-22 02:56:07 +08:00
|
|
|
|
|
|
|
|
2013-08-23 04:57:34 +08:00
|
|
|
find_library(CURSES_LIBRARY "curses")
|
|
|
|
find_library(CURSESW_LIBRARY "cursesw")
|
2013-08-22 02:56:07 +08:00
|
|
|
|
2013-08-23 04:57:34 +08:00
|
|
|
find_library(NCURSES_LIBRARY "ncurses")
|
|
|
|
find_library(NCURSESW_LIBRARY "ncursesw")
|
2013-08-22 02:56:07 +08:00
|
|
|
|
2013-08-23 04:57:34 +08:00
|
|
|
if(NOT NO_WIDECHAR AND (CURSESW_LIBRARY OR NCURSESW_LIBRARY))
|
|
|
|
message(STATUS "Found wide character support")
|
|
|
|
set(CURSES_HAVE_WIDE_CHAR TRUE)
|
|
|
|
if(NCURSESW_LIBRARY)
|
|
|
|
set(CURSES_LIBRARIES ${NCURSESW_LIBRARY})
|
|
|
|
else()
|
|
|
|
set(CURSES_LIBRARIES ${CURSESW_LIBRARY})
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
message(STATUS "Could not found wide character support")
|
|
|
|
if(NCURSES_LIBRARY)
|
|
|
|
set(CURSES_LIBRARIES ${NCURSES_LIBRARY})
|
|
|
|
else()
|
|
|
|
set(CURSES_LIBRARIES ${CURSES_LIBRARY})
|
|
|
|
endif()
|
|
|
|
endif()
|
2013-08-22 02:56:07 +08:00
|
|
|
|
|
|
|
|
2013-08-23 04:57:34 +08:00
|
|
|
# We use curses.h not ncurses.h so let's not care about that for now
|
2013-08-22 02:56:07 +08:00
|
|
|
|
2013-08-23 04:57:34 +08:00
|
|
|
if(CURSES_HAVE_WIDE_CHAR)
|
|
|
|
find_path(CURSES_INCLUDE_PATH curses.h PATH_SUFFIXES ncursesw)
|
|
|
|
else()
|
|
|
|
find_path(CURSES_INCLUDE_PATH curses.h PATH_SUFFIXES ncurses)
|
|
|
|
endif()
|
2013-08-22 02:56:07 +08:00
|
|
|
|
2013-08-23 04:57:34 +08:00
|
|
|
set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
|
2013-08-22 02:56:07 +08:00
|
|
|
|
2013-08-23 04:57:34 +08:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Cursesw DEFAULT_MSG CURSES_INCLUDE_DIR CURSES_LIBRARIES)
|
2013-08-22 02:56:07 +08:00
|
|
|
|
|
|
|
|