summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-04-22 09:16:15 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2008-04-22 09:16:15 +0000
commitccea1b4ed51d39d72efa77127d0ebbc10c1ea7fe (patch)
tree6b857e2dbe9da0a8feedafcabfd71269677ad794
parentc56899761c2908caab683fa89937860551c8652f (diff)
downloadpcre-ccea1b4ed51d39d72efa77127d0ebbc10c1ea7fe.tar.gz
CMake patches for readline support to ensure ncurses is linked when required.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@344 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--CMakeLists.txt9
-rw-r--r--ChangeLog5
-rw-r--r--cmake/FindReadline.cmake14
3 files changed, 25 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e896d2c..b711988 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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 @@ IF(PCRE_SUPPORT_UNICODE_PROPERTIES)
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)
diff --git a/ChangeLog b/ChangeLog
index 7270c08..f11747d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -97,6 +97,11 @@ Version 7.7 05-Mar-08
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öm.
Version 7.6 28-Jan-08
diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake
index 6899f88..1d4cc55 100644
--- a/cmake/FindReadline.cmake
+++ b/cmake/FindReadline.cmake
@@ -9,11 +9,21 @@ else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
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)