summaryrefslogtreecommitdiff
path: root/Modules/FindCurses.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-03-30 09:09:51 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2008-03-30 09:09:51 -0400
commitbf5f91f058155c136443e922a3bec6811729a0f3 (patch)
tree4801b7fa211ef0fb9a81d87fb36a16f53cfeb5b9 /Modules/FindCurses.cmake
parent69e3f0d2e9d0f9351383fe492e1f2399c5c82565 (diff)
downloadcmake-bf5f91f058155c136443e922a3bec6811729a0f3.tar.gz
ENH: merge from main tree
Diffstat (limited to 'Modules/FindCurses.cmake')
-rw-r--r--Modules/FindCurses.cmake23
1 files changed, 11 insertions, 12 deletions
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index fffe188c99..cd170c1268 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -7,19 +7,20 @@
# CURSES_HAVE_NCURSES_H - true if ncurses.h is available
# CURSES_HAVE_NCURSES_NCURSES_H - true if ncurses/ncurses.h is available
# CURSES_HAVE_NCURSES_CURSES_H - true if ncurses/curses.h is available
+# CURSES_LIBRARY - set for backwards compatibility with 2.4 CMake
#
# Set CURSES_NEED_NCURSES to TRUE before the FIND_PACKAGE() command if NCurses
# functionality is required.
-FIND_LIBRARY(CURSES_CURSES_LIBRARY NAMES curses )
+FIND_LIBRARY(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_LIBRARY)
SET(CURSES_USE_NCURSES TRUE)
-ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
+ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_LIBRARY)
# Not sure the logic is correct here.
@@ -33,9 +34,9 @@ ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
# So at first try ncurses.h, if not found, try to find curses.h under the same
# prefix as the library was found, if still not found, try curses.h with the
# default search paths.
-IF(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
+IF(CURSES_LIBRARY AND CURSES_NEED_NCURSES)
INCLUDE(CheckLibraryExists)
- CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}" wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
+ CHECK_LIBRARY_EXISTS("${CURSES_LIBRARY}" wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
IF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP)
CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" wsyncup "" CURSES_NCURSES_HAS_WSYNCUP)
@@ -44,16 +45,14 @@ IF(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
ENDIF( CURSES_NCURSES_HAS_WSYNCUP)
ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP)
-ENDIF(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
+ENDIF(CURSES_LIBRARY AND CURSES_NEED_NCURSES)
IF(NOT CURSES_USE_NCURSES)
FIND_FILE(CURSES_HAVE_CURSES_H curses.h )
- FIND_PATH(CURSES_CURSES_H_PATH curses.h )
- SET(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}")
+ FIND_PATH(CURSES_INCLUDE_PATH curses.h )
- SET(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}")
- GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
+ GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_LIBRARY}" PATH)
GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
ELSE(NOT CURSES_USE_NCURSES)
# we need to find ncurses
@@ -71,7 +70,7 @@ ELSE(NOT CURSES_USE_NCURSES)
FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h)
SET(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}")
- SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}")
+ SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}" CACHE FILEPATH "path to curses")
ENDIF(NOT CURSES_USE_NCURSES)
@@ -107,7 +106,7 @@ MARK_AS_ADVANCED(
CURSES_INCLUDE_PATH
CURSES_LIBRARY
CURSES_CURSES_INCLUDE_PATH
- CURSES_CURSES_LIBRARY
+ CURSES_LIBRARY
CURSES_NCURSES_INCLUDE_PATH
CURSES_NCURSES_LIBRARY
CURSES_EXTRA_LIBRARY