summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2019-02-16 11:58:37 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2019-02-16 11:58:37 +0000
commit2b124cc0b7ea8332c97c9acf38ca4f1a7d7eb859 (patch)
tree5ec73f906997511b0da505a0da5da73efe08e982
parent94f5c8bb52dc75cfb64b375cbcc1c646434e07f6 (diff)
downloadpcre2-2b124cc0b7ea8332c97c9acf38ca4f1a7d7eb859.tar.gz
Try to fix CMake old policy warning issue.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1076 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--CMakeLists.txt29
-rw-r--r--ChangeLog7
2 files changed, 29 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0306bc4..eb4f410 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,14 +84,16 @@
# 2018-06-27 PH added Daniel's patch to increase the stack for MSVC
# 2018-11-14 PH removed unnecessary checks for stdint.h and inttypes.h
# 2018-11-16 PH added PCRE2GREP_SUPPORT_CALLOUT_FORK support and tidied
+# 2019-02-16 PH hacked to avoid CMP0026 policy issue (see comments below)
PROJECT(PCRE2 C)
-# Increased minimum to 2.8.0 to support newer add_test features. Set policy
-# CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY.
-
+# Increased minimum to 2.8.0 to support newer add_test features.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0)
-CMAKE_POLICY(SET CMP0026 OLD)
+
+# Set policy CMP0026 to avoid warnings for the use of LOCATION in
+# GET_TARGET_PROPERTY. This should no longer be required.
+# CMAKE_POLICY(SET CMP0026 OLD)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake
@@ -647,14 +649,27 @@ IF(PCRE2_BUILD_TESTS)
TARGET_LINK_LIBRARIES(pcre2_jit_test ${PCRE2_JIT_TEST_LIBS})
ENDIF(PCRE2_SUPPORT_JIT)
- # exes in Debug location tested by the RunTest shell script
+ # exes in Debug location tested by the RunTest and RunGrepTest shell scripts
# via "make test"
+
+ # The commented out code below provokes a warning about future removal
+ # of the facility, and requires policy CMP0026 to be set to "OLD". I have
+ # got fed-up with the warnings, but my plea for help on the mailing list
+ # produced no response. So, I've hacked. The new code below seems to work on
+ # Linux.
+
+# IF(PCRE2_BUILD_PCRE2GREP)
+# GET_TARGET_PROPERTY(PCRE2GREP_EXE pcre2grep DEBUG_LOCATION)
+# ENDIF(PCRE2_BUILD_PCRE2GREP)
+#
+# GET_TARGET_PROPERTY(PCRE2TEST_EXE pcre2test DEBUG_LOCATION)
IF(PCRE2_BUILD_PCRE2GREP)
- GET_TARGET_PROPERTY(PCRE2GREP_EXE pcre2grep DEBUG_LOCATION)
+ SET(PCRE2GREP_EXE $<TARGET_FILE:pcre2grep>)
ENDIF(PCRE2_BUILD_PCRE2GREP)
- GET_TARGET_PROPERTY(PCRE2TEST_EXE pcre2test DEBUG_LOCATION)
+ SET(PCRE2TEST_EXE $<TARGET_FILE:pcre2test>)
+
# =================================================
# Write out a CTest configuration file
diff --git a/ChangeLog b/ChangeLog
index a3c81a4..9bbeb88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -133,6 +133,13 @@ from auto-anchoring if \p{Any}* starts a pattern.
33. Compile invalid UTF check in JIT test when only pcre32 is enabled.
+34. For some time now, CMake has been warning about the setting of policy
+CMP0026 to "OLD" in CmakeLists.txt, and hinting that the feature might be
+removed in a future version. A request for CMake expertise on the list produced
+no result, so I have now hacked CMakeLists.txt along the lines of some changes
+I found on the Internet. The new code no longer needs the policy setting, and
+it appears to work fine on Linux.
+
Version 10.32 10-September-2018
-------------------------------