diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-03-28 14:08:27 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-03-28 14:08:27 (GMT) |
commit | cb1cdada76c6ac8535fdab52bae5b63c51029eae (patch) | |
tree | 70e321cbba850fd36d1297ac4dd2f39d5e76a516 /Modules/FindCurses.cmake | |
parent | 07cb082722b16df9bc709e150048cec617bed2d1 (diff) | |
download | CMake-cb1cdada76c6ac8535fdab52bae5b63c51029eae.zip CMake-cb1cdada76c6ac8535fdab52bae5b63c51029eae.tar.gz CMake-cb1cdada76c6ac8535fdab52bae5b63c51029eae.tar.bz2 |
ENH: make this backwards compatible with older FindCurses
Diffstat (limited to 'Modules/FindCurses.cmake')
-rw-r--r-- | Modules/FindCurses.cmake | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index fffe188..1dcf70b 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,7 +45,7 @@ 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) @@ -52,8 +53,7 @@ IF(NOT CURSES_USE_NCURSES) FIND_PATH(CURSES_CURSES_H_PATH curses.h ) SET(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}") - 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 +71,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 +107,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 |