[Cmake-commits] [cmake-commits] alex committed FindCurses.cmake 1.14 1.15

cmake-commits at cmake.org cmake-commits at cmake.org
Sat May 10 19:07:49 EDT 2008


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv15400

Modified Files:
	FindCurses.cmake 
Log Message:
BUG: fix #6993
FindCurses.cmake is now almost exactly reverted back to the state when
CURSES_LIBRARY and CURSES_INCLUDE_PATH where set for compatibility but not
in the cache. It is important that CURSES_CURSES_LIBRARY and
CURSES_NCURSES_LIBRARY really contain the path to these files. 
Later on CURSES_LIBRARY is set to the one of the two which will be 
used as curses library. This is now done in the cache, without FORCE. 
So preloading the cache still seems to work (at least what I tested).

Alex



Index: FindCurses.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindCurses.cmake,v
retrieving revision 1.14
retrieving revision 1.15
diff -C 2 -d -r1.14 -r1.15
*** FindCurses.cmake	30 Apr 2008 19:53:33 -0000	1.14
--- FindCurses.cmake	10 May 2008 23:07:47 -0000	1.15
***************
*** 13,17 ****
  # functionality is required.
  
! FIND_LIBRARY(CURSES_LIBRARY NAMES curses )
  
  FIND_LIBRARY(CURSES_NCURSES_LIBRARY NAMES ncurses )
--- 13,17 ----
  # functionality is required.
  
! FIND_LIBRARY(CURSES_CURSES_LIBRARY NAMES curses )
  
  FIND_LIBRARY(CURSES_NCURSES_LIBRARY NAMES ncurses )
***************
*** 19,25 ****
  SET(CURSES_USE_NCURSES FALSE)
  
! IF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_LIBRARY)
    SET(CURSES_USE_NCURSES TRUE)
! ENDIF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_LIBRARY)
  
  
--- 19,25 ----
  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)
  
  
***************
*** 35,41 ****
  # prefix as the library was found, if still not found, try curses.h with the 
  # default search paths.
! IF(CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
    INCLUDE(CheckLibraryExists)
!   CHECK_LIBRARY_EXISTS("${CURSES_LIBRARY}" wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
  
    IF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
--- 35,41 ----
  # 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)
!   CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}" wsyncup "" CURSES_CURSES_HAS_WSYNCUP)
  
    IF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
***************
*** 46,58 ****
    ENDIF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
  
! ENDIF(CURSES_LIBRARY  AND  CURSES_NEED_NCURSES)
  
  
  IF(NOT CURSES_USE_NCURSES)
    FIND_FILE(CURSES_HAVE_CURSES_H curses.h )
!   FIND_PATH(CURSES_INCLUDE_PATH curses.h )
! 
!   GET_FILENAME_COMPONENT(_cursesLibDir "${CURSES_LIBRARY}" PATH)
    GET_FILENAME_COMPONENT(_cursesParentDir "${_cursesLibDir}" PATH)
  ELSE(NOT CURSES_USE_NCURSES)
  # we need to find ncurses
--- 46,62 ----
    ENDIF(CURSES_NCURSES_LIBRARY  AND NOT  CURSES_CURSES_HAS_WSYNCUP)
  
! 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)
+ 
+   # 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}" CACHE FILEPATH "The curses include path")
+   SET(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}" CACHE FILEPATH "The curses library")
  ELSE(NOT CURSES_USE_NCURSES)
  # we need to find ncurses
***************
*** 70,82 ****
    FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h)
  
!   SET(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}")
!   SET(FORCE_ARG "")
!   IF("${CURSES_LIBRARY}" STREQUAL "CURSES_LIBRARY-NOTFOUND")
!     SET(FORCE_ARG "FORCE")
!   ENDIF("${CURSES_LIBRARY}" STREQUAL "CURSES_LIBRARY-NOTFOUND")
!   SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}" CACHE FILEPATH "path to curses" ${FORCE_ARG})
  ENDIF(NOT CURSES_USE_NCURSES)
  
  
  FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr PATHS "${_cursesLibDir}" NO_DEFAULT_PATH)
  FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr )
--- 74,85 ----
    FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h)
  
!   # 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_NCURSES_INCLUDE_PATH}" CACHE FILEPATH "The curses include path")
!   SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}" CACHE FILEPATH "The curses library")
  ENDIF(NOT CURSES_USE_NCURSES)
  
  
+ 
  FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr PATHS "${_cursesLibDir}" NO_DEFAULT_PATH)
  FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr )
***************
*** 85,88 ****
--- 88,96 ----
  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 wqith these variables set
+ SET(FORM_LIBRARY "${CURSES_FORM_LIBRARY}"            CACHE FILEPATH "The curses form library")
+ 
+ 
  # Need to provide the *_LIBRARIES
  SET(CURSES_LIBRARIES ${CURSES_LIBRARY})
***************
*** 104,115 ****
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG CURSES_LIBRARY CURSES_INCLUDE_PATH)
  
- # for compatibility
- SET(FORM_LIBRARY "${CURSES_FORM_LIBRARY}")
- 
  MARK_AS_ADVANCED(
    CURSES_INCLUDE_PATH
    CURSES_LIBRARY
    CURSES_CURSES_INCLUDE_PATH
!   CURSES_LIBRARY
    CURSES_NCURSES_INCLUDE_PATH
    CURSES_NCURSES_LIBRARY
--- 112,120 ----
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG CURSES_LIBRARY CURSES_INCLUDE_PATH)
  
  MARK_AS_ADVANCED(
    CURSES_INCLUDE_PATH
    CURSES_LIBRARY
    CURSES_CURSES_INCLUDE_PATH
!   CURSES_CURSES_LIBRARY
    CURSES_NCURSES_INCLUDE_PATH
    CURSES_NCURSES_LIBRARY



More information about the Cmake-commits mailing list