summaryrefslogtreecommitdiffstats
path: root/Modules/FindCurses.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-08 15:27:49 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-05-08 15:27:49 (GMT)
commitd02e58c4709c76bd19aeeac29cb845dc91aebf11 (patch)
treed9d7d31eecb41d11f424c930383fd04be64ce510 /Modules/FindCurses.cmake
parent159cc31f633b89498f1989569dfde3d0b822e671 (diff)
parent1f646c6ce0766f8ab59868e7cac24034e6966504 (diff)
downloadCMake-d02e58c4709c76bd19aeeac29cb845dc91aebf11.zip
CMake-d02e58c4709c76bd19aeeac29cb845dc91aebf11.tar.gz
CMake-d02e58c4709c76bd19aeeac29cb845dc91aebf11.tar.bz2
Merge topic 'ncurses-tinfo'
1f646c6c FindCurses: Detect and satisfy ncurses dependency on tinfo 0e4a2c7e FindCurses: Honor CURSES_NEED_NCURSES when curses is found
Diffstat (limited to 'Modules/FindCurses.cmake')
-rw-r--r--Modules/FindCurses.cmake18
1 files changed, 15 insertions, 3 deletions
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index fa420c1..9b633c7 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -40,7 +40,7 @@ find_library(CURSES_CURSES_LIBRARY NAMES curses )
find_library(CURSES_NCURSES_LIBRARY NAMES ncurses )
set(CURSES_USE_NCURSES FALSE)
-if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
+if(CURSES_NCURSES_LIBRARY AND ((NOT CURSES_CURSES_LIBRARY) OR CURSES_NEED_NCURSES))
set(CURSES_USE_NCURSES TRUE)
endif()
# http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
@@ -139,10 +139,20 @@ else()
CACHE FILEPATH "The curses library" ${FORCE_IT})
endif()
+ CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
+ cbreak "" CURSES_NCURSES_HAS_CBREAK)
+ if(NOT CURSES_NCURSES_HAS_CBREAK)
+ find_library(CURSES_EXTRA_LIBRARY tinfo HINTS "${_cursesLibDir}")
+ find_library(CURSES_EXTRA_LIBRARY tinfo )
+ CHECK_LIBRARY_EXISTS("${CURSES_EXTRA_LIBRARY}"
+ cbreak "" CURSES_TINFO_HAS_CBREAK)
+ endif()
endif()
-find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
-find_library(CURSES_EXTRA_LIBRARY cur_colr )
+if (NOT CURSES_TINFO_HAS_CBREAK)
+ find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
+ find_library(CURSES_EXTRA_LIBRARY cur_colr )
+endif()
find_library(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
find_library(CURSES_FORM_LIBRARY form )
@@ -186,5 +196,7 @@ mark_as_advanced(
CURSES_INCLUDE_DIR
CURSES_CURSES_HAS_WSYNCUP
CURSES_NCURSES_HAS_WSYNCUP
+ CURSES_NCURSES_HAS_CBREAK
+ CURSES_TINFO_HAS_CBREAK
)