Revision: 886
http://vcs.pcre.org/viewvc?view=rev&revision=886
Author: ph10
Date: 2012-01-17 14:25:07 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
CMake parses version information out of configure.ac instead of relying on
pcre.h.generic.
Modified Paths:
--------------
code/trunk/CMakeLists.txt
code/trunk/ChangeLog
code/trunk/configure.ac
Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt 2012-01-17 14:12:47 UTC (rev 885)
+++ code/trunk/CMakeLists.txt 2012-01-17 14:25:07 UTC (rev 886)
@@ -54,6 +54,8 @@
# 2012-01-06 PH removed pcre_info.c and added pcre_string_utils.c
# 2012-01-10 Zoltan Herczeg added libpcre16 support
# 2012-01-13 Stephen Kelly added out of source build support
+# 2012-01-17 PH applied Stephen Kelly's patch to parse the version data out
+# of the configure.ac file
PROJECT(PCRE C CXX)
@@ -314,9 +316,29 @@
${PROJECT_BINARY_DIR}/config.h
@ONLY)
-CONFIGURE_FILE(pcre.h.generic
+# Parse version numbers and date out of configure.ac
+
+file(STRINGS ${PROJECT_SOURCE_DIR}/configure.ac
+ configure_lines
+ LIMIT_COUNT 50 # Read only the first 50 lines of the file
+)
+
+set(SEARCHED_VARIABLES "pcre_major" "pcre_minor" "pcre_prerelease" "pcre_date")
+foreach(configure_line ${configure_lines})
+ foreach(_substitution_variable ${SEARCHED_VARIABLES})
+ string(TOUPPER ${_substitution_variable} _substitution_variable_upper)
+ if (NOT ${_substitution_variable_upper})
+ string(REGEX MATCH "m4_define\\(${_substitution_variable}, \\[(.*)\\]" MACTHED_STRING ${configure_line})
+ if (CMAKE_MATCH_1)
+ set(${_substitution_variable_upper} ${CMAKE_MATCH_1})
+ endif()
+ endif()
+ endforeach()
+endforeach()
+
+CONFIGURE_FILE(pcre.h.in
${PROJECT_BINARY_DIR}/pcre.h
- COPYONLY)
+ @ONLY)
# What about pcre-config and libpcre.pc?
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2012-01-17 14:12:47 UTC (rev 885)
+++ code/trunk/ChangeLog 2012-01-17 14:25:07 UTC (rev 886)
@@ -43,6 +43,10 @@
Oddly, Perl behaves the same way. PCRE has been fixed so that this pattern
also returns the mark "x". This bug applied to capturing parentheses,
non-capturing parentheses, and atomic parentheses.
+
+12. Stephen Kelly's patch to CMakeLists.txt allows it to parse the version
+ information out of configure.ac instead of relying on pcre.h.generic, which
+ is not stored in the repository.
Version 8.21 12-Dec-2011
Modified: code/trunk/configure.ac
===================================================================
--- code/trunk/configure.ac 2012-01-17 14:12:47 UTC (rev 885)
+++ code/trunk/configure.ac 2012-01-17 14:25:07 UTC (rev 886)
@@ -13,6 +13,9 @@
m4_define(pcre_prerelease, [-PT1])
m4_define(pcre_date, [2012-01-01])
+# NOTE: The CMakeLists.txt file searches for the above variables in the first
+# 50 lines of this file. Please update that if the variables above are moved.
+
# Libtool shared library interface versions (current:revision:age)
m4_define(libpcre_version, [1:0:0])
m4_define(libpcre16_version, [0:0:0])