summaryrefslogtreecommitdiffstats
path: root/Modules/FindCurses.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-27 13:01:14 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-27 13:01:14 (GMT)
commitc41f7983838a654c830edc94470be4defd0f1686 (patch)
tree648a0b4cf71d39365430d5667db3964f404ef461 /Modules/FindCurses.cmake
parenta764593f1d4f67d9b89d0a128c6cd69114097865 (diff)
downloadCMake-c41f7983838a654c830edc94470be4defd0f1686.zip
CMake-c41f7983838a654c830edc94470be4defd0f1686.tar.gz
CMake-c41f7983838a654c830edc94470be4defd0f1686.tar.bz2
COMP: make it build on NetBSD, which has separate curses and ncurses, so
it has to be detected that curses isn't good enough, but ncurses is, and that ncurses.h instead of curses.h is included Alex
Diffstat (limited to 'Modules/FindCurses.cmake')
-rw-r--r--Modules/FindCurses.cmake19
1 files changed, 16 insertions, 3 deletions
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index e4ca140..fffe188 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -3,6 +3,10 @@
# CURSES_FOUND - system has Curses
# CURSES_INCLUDE_DIR - the Curses include directory
# CURSES_LIBRARIES - The libraries needed to use Curses
+# CURSES_HAVE_CURSES_H - true if curses.h is available
+# 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
#
# Set CURSES_NEED_NCURSES to TRUE before the FIND_PACKAGE() command if NCurses
# functionality is required.
@@ -44,16 +48,25 @@ ENDIF(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
IF(NOT CURSES_USE_NCURSES)
- FIND_PATH(CURSES_CURSES_INCLUDE_PATH curses.h )
- SET(CURSES_INCLUDE_PATH "${CURSES_CURSES_INCLUDE_PATH}")
+ FIND_FILE(CURSES_HAVE_CURSES_H curses.h )
+ 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(_cursesParentDir "${_cursesLibDir}" PATH)
ELSE(NOT CURSES_USE_NCURSES)
# we need to find ncurses
- FIND_PATH(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h ncurses/curses.h)
GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
+
+ FIND_FILE(CURSES_HAVE_NCURSES_H ncurses.h)
+ FIND_FILE(CURSES_HAVE_NCURSES_NCURSES_H ncurses/ncurses.h)
+ FIND_FILE(CURSES_HAVE_NCURSES_CURSES_H ncurses/curses.h)
+ FIND_FILE(CURSES_HAVE_CURSES_H curses.h PATHS "${_cursesParentDir}/include" NO_DEFAULT_PATH)
+ FIND_FILE(CURSES_HAVE_CURSES_H curses.h)
+
+ FIND_PATH(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h ncurses/curses.h)
FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h PATHS "${_cursesParentDir}/include" NO_DEFAULT_PATH)
FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h)