summaryrefslogtreecommitdiffstats
path: root/Modules/FindCurses.cmake
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 17:47:32 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:19:16 (GMT)
commit77543bde41b0e52c3959016698b529835945d62d (patch)
treeff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Modules/FindCurses.cmake
parent7bbaa4283de26864b2e55e819db0884771585467 (diff)
downloadCMake-77543bde41b0e52c3959016698b529835945d62d.zip
CMake-77543bde41b0e52c3959016698b529835945d62d.tar.gz
CMake-77543bde41b0e52c3959016698b529835945d62d.tar.bz2
Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
Diffstat (limited to 'Modules/FindCurses.cmake')
-rw-r--r--Modules/FindCurses.cmake134
1 files changed, 67 insertions, 67 deletions
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index 0ea5166..de71992 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -9,7 +9,7 @@
# 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
+# Set CURSES_NEED_NCURSES to TRUE before the find_package() command if NCurses
# functionality is required.
#=============================================================================
@@ -25,23 +25,23 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_LIBRARY(CURSES_CURSES_LIBRARY NAMES curses )
+find_library(CURSES_CURSES_LIBRARY NAMES curses )
-FIND_LIBRARY(CURSES_NCURSES_LIBRARY NAMES ncurses )
-SET(CURSES_USE_NCURSES FALSE)
+find_library(CURSES_NCURSES_LIBRARY NAMES ncurses )
+set(CURSES_USE_NCURSES FALSE)
-IF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
- SET(CURSES_USE_NCURSES TRUE)
-ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
+if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
+ set(CURSES_USE_NCURSES TRUE)
+endif(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_LIBRARY)
# http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
# cygwin ncurses stopped providing curses.h symlinks see above
# message. Cygwin is an ncurses package, so force ncurses on
# cygwin if the curses.h is missing
-IF(CYGWIN)
- IF(NOT EXISTS /usr/include/curses.h)
- SET(CURSES_USE_NCURSES TRUE)
- ENDIF()
-ENDIF()
+if(CYGWIN)
+ if(NOT EXISTS /usr/include/curses.h)
+ set(CURSES_USE_NCURSES TRUE)
+ endif()
+endif()
# Not sure the logic is correct here.
@@ -55,48 +55,48 @@ ENDIF()
# 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)
- INCLUDE(CheckLibraryExists)
+if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES)
+ include(CheckLibraryExists)
CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}"
wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
- IF(CURSES_NCURSES_LIBRARY AND NOT 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)
- IF( CURSES_NCURSES_HAS_WSYNCUP)
- SET(CURSES_USE_NCURSES TRUE)
- ENDIF( CURSES_NCURSES_HAS_WSYNCUP)
- ENDIF(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP)
+ if( CURSES_NCURSES_HAS_WSYNCUP)
+ set(CURSES_USE_NCURSES TRUE)
+ 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_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 )
- GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
- GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
+if(NOT CURSES_USE_NCURSES)
+ find_file(CURSES_HAVE_CURSES_H curses.h )
+ find_path(CURSES_CURSES_H_PATH curses.h )
+ get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
+ get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH)
# for compatibility with older FindCurses.cmake this has to be in the cache
# FORCE must not be used since this would break builds which preload a cache wqith these variables set
- SET(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
+ set(CURSES_INCLUDE_PATH "${CURSES_CURSES_H_PATH}"
CACHE FILEPATH "The curses include path")
- SET(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
+ set(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}"
CACHE FILEPATH "The curses library")
-ELSE(NOT CURSES_USE_NCURSES)
+else(NOT CURSES_USE_NCURSES)
# we need to find ncurses
- GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH)
- GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
+ 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
+ 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
HINTS "${_cursesParentDir}/include")
- FIND_PATH(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
+ find_path(CURSES_NCURSES_INCLUDE_PATH ncurses.h ncurses/ncurses.h
ncurses/curses.h)
- FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h
+ find_path(CURSES_NCURSES_INCLUDE_PATH curses.h
HINTS "${_cursesParentDir}/include")
# for compatibility with older FindCurses.cmake this has to be in the cache
@@ -106,60 +106,60 @@ ELSE(NOT CURSES_USE_NCURSES)
# a cache wqith these variables set
# only put ncurses include and library into
# variables if they are found
- IF(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
- GET_FILENAME_COMPONENT(CURSES_NCURSES_INCLUDE_PATH
+ if(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
+ get_filename_component(CURSES_NCURSES_INCLUDE_PATH
"${CURSES_HAVE_NCURSES_NCURSES_H}" PATH)
- ENDIF(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
- IF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
- SET( FORCE_IT )
- IF(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
- SET(FORCE_IT FORCE)
- ENDIF(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
- SET(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
+ endif(NOT CURSES_NCURSES_INCLUDE_PATH AND CURSES_HAVE_NCURSES_NCURSES_H)
+ if(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
+ set( FORCE_IT )
+ if(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
+ set(FORCE_IT FORCE)
+ endif(CURSES_INCLUDE_PATH MATCHES NOTFOUND)
+ set(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}"
CACHE FILEPATH "The curses include path" ${FORCE_IT})
- SET( FORCE_IT)
- IF(CURSES_LIBRARY MATCHES NOTFOUND)
- SET(FORCE_IT FORCE)
- ENDIF(CURSES_LIBRARY MATCHES NOTFOUND)
- SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
+ set( FORCE_IT)
+ if(CURSES_LIBRARY MATCHES NOTFOUND)
+ set(FORCE_IT FORCE)
+ endif(CURSES_LIBRARY MATCHES NOTFOUND)
+ set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}"
CACHE FILEPATH "The curses library" ${FORCE_IT})
- ENDIF(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
+ endif(CURSES_NCURSES_INCLUDE_PATH AND CURSES_NCURSES_LIBRARY)
-ENDIF(NOT CURSES_USE_NCURSES)
+endif(NOT CURSES_USE_NCURSES)
-FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
-FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr )
+find_library(CURSES_EXTRA_LIBRARY cur_colr HINTS "${_cursesLibDir}")
+find_library(CURSES_EXTRA_LIBRARY cur_colr )
-FIND_LIBRARY(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
-FIND_LIBRARY(CURSES_FORM_LIBRARY form )
+find_library(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}")
+find_library(CURSES_FORM_LIBRARY form )
# for compatibility with older FindCurses.cmake this has to be in the cache
# FORCE must not be used since this would break builds which preload a cache
# qith these variables set
-SET(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
+set(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"
CACHE FILEPATH "The curses form library")
# Need to provide the *_LIBRARIES
-SET(CURSES_LIBRARIES ${CURSES_LIBRARY})
+set(CURSES_LIBRARIES ${CURSES_LIBRARY})
-IF(CURSES_EXTRA_LIBRARY)
- SET(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
-ENDIF(CURSES_EXTRA_LIBRARY)
+if(CURSES_EXTRA_LIBRARY)
+ set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY})
+endif(CURSES_EXTRA_LIBRARY)
-IF(CURSES_FORM_LIBRARY)
- SET(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
-ENDIF(CURSES_FORM_LIBRARY)
+if(CURSES_FORM_LIBRARY)
+ set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
+endif(CURSES_FORM_LIBRARY)
# Proper name is *_INCLUDE_DIR
-SET(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
+set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH})
# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if
# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG
CURSES_LIBRARY CURSES_INCLUDE_PATH)
-MARK_AS_ADVANCED(
+mark_as_advanced(
CURSES_INCLUDE_PATH
CURSES_LIBRARY
CURSES_CURSES_INCLUDE_PATH