[Pcre-svn] [344] code/trunk: CMake patches for readline supp…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [344] code/trunk: CMake patches for readline support to ensure ncurses is linked when required .
Revision: 344
          http://vcs.pcre.org/viewvc?view=rev&revision=344
Author:   ph10
Date:     2008-04-22 10:16:15 +0100 (Tue, 22 Apr 2008)


Log Message:
-----------
CMake patches for readline support to ensure ncurses is linked when required.

Modified Paths:
--------------
    code/trunk/CMakeLists.txt
    code/trunk/ChangeLog
    code/trunk/cmake/FindReadline.cmake


Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt    2008-04-21 16:30:37 UTC (rev 343)
+++ code/trunk/CMakeLists.txt    2008-04-22 09:16:15 UTC (rev 344)
@@ -25,6 +25,7 @@
 #            libpcre-0.dll, libpcreposix-0.dll and libpcrecpp-0.dll - same names
 #            built by default with Configure and Make.
 # 2008-01-23 PH removed the automatic build of pcredemo.
+# 2008-04-22 PH modified READLINE support so it finds NCURSES when needed.


PROJECT(PCRE C CXX)

@@ -178,9 +179,15 @@
         SET(SUPPORT_UCP 1)
 ENDIF(PCRE_SUPPORT_UNICODE_PROPERTIES)


+# This next one used to contain
+#       SET(PCRETEST_LIBS ${READLINE_LIBRARY})
+# but I was advised to add the NCURSES test as well, along with
+# some modifications to cmake/FindReadline.cmake which should
+# make it possible to override the default if necessary. PH
+
 IF(PCRE_SUPPORT_LIBREADLINE)
         SET(SUPPORT_LIBREADLINE 1)
-        SET(PCRETEST_LIBS ${READLINE_LIBRARY})
+        SET(PCRETEST_LIBS ${READLINE_LIBRARY} ${NCURSES_LIBRARY})
 ENDIF(PCRE_SUPPORT_LIBREADLINE)


IF(PCRE_SUPPORT_LIBZ)

Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2008-04-21 16:30:37 UTC (rev 343)
+++ code/trunk/ChangeLog    2008-04-22 09:16:15 UTC (rev 344)
@@ -97,6 +97,11 @@
 17. Compiling pcretest on Windows with readline support failed without the 
     following two fixes: (1) Make the unistd.h include conditional on
     HAVE_UNISTD_H; (2) #define isatty and fileno as _isatty and _fileno. 
+    
+18. Changed CMakeLists.txt and cmake/FindReadline.cmake to arrange for the
+    ncurses library to be included for pcretest when ReadLine support is 
+    requested, but also to allow for it to be overridden. This patch came from 
+    Daniel Bergstr\xF6m.  



Version 7.6 28-Jan-08

Modified: code/trunk/cmake/FindReadline.cmake
===================================================================
--- code/trunk/cmake/FindReadline.cmake    2008-04-21 16:30:37 UTC (rev 343)
+++ code/trunk/cmake/FindReadline.cmake    2008-04-22 09:16:15 UTC (rev 344)
@@ -9,11 +9,21 @@
   FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h
     /usr/include/readline
   )
+  
+# 2008-04-22 The next clause used to read like this:
+#
+#  FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
+#        FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses )
+#        include(FindPackageHandleStandardArgs)
+#        FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY )
+#
+# I was advised to modify it such that it will find an ncurses library if
+# required, but not if one was explicitly given, that is, it allows the
+# default to be overridden. PH 


   FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
-        FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses )
         include(FindPackageHandleStandardArgs)
-        FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY )
+        FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY )


MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)