1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

Fix ncurses detection.

We now provide a FindNcurses.cmake to find the library used
and we define the right cpp variable when we compile the curses gui.

Signed-off-by: Julien Louis <ptitlouis@sysif.net>
This commit is contained in:
Julien Louis
2007-05-21 22:20:13 +00:00
parent ba468f2234
commit e867f2dd35
4 changed files with 70 additions and 22 deletions
+12 -11
View File
@@ -21,19 +21,20 @@ gui-curses-status.c gui-curses-window.c gui-curses-panel.c gui-curses.h)
SET(EXECUTABLE weechat-curses)
INCLUDE(CheckLibraryExists)
# Check for ncurses and/or ncursesw
CHECK_INCLUDE_FILES(ncursesw/ncurses.h NCURSESW_HEADERS)
CHECK_LIBRARY_EXISTS(ncursesw initscr "" NCURSESW_FOUND)
FIND_PACKAGE(Ncurses)
IF(NCURSES_FOUND)
CHECK_INCLUDE_FILES(ncursesw/ncurses.h NCURSESW_HEADERS)
IF(NCURSESW_HEADERS)
ADD_DEFINITIONS(-DHAVE_NCURSESW_CURSES_H)
ENDIF(NCURSESW_HEADERS)
IF(NCURSESW_FOUND)
ADD_DEFINITIONS(-DHAVE_NCURSESW_CURSES_H)
LIST(APPEND EXTRA_LIBS ncursesw)
ELSE(NCURSESW_FOUND)
CHECK_INCLUDE_FILES(ncurses.h NCURSES_HEADERS)
CHECK_LIBRARY_EXISTS(ncurses initscr "" NCURSES_FOUND)
LIST(APPEND EXTRA_LIBS ncurses)
ENDIF(NCURSESW_FOUND)
IF(NCURSES_HEADERS)
ADD_DEFINITIONS(-DHAVE_NCURSES_H)
ENDIF(NCURSES_HEADERS)
LIST(APPEND EXTRA_LIBS ${NCURSES_LIBRARY})
ENDIF(NCURSES_FOUND)
ADD_EXECUTABLE(${EXECUTABLE} ${WEECHAT_CURSES_SRC})
INCLUDE_DIRECTORIES(.. ../../common ../../irc ../../plugins)