[Pcre-svn] [1076] code/trunk: Try to fix CMake old policy wa…

Inizio della pagina
Delete this message
Autore: Subversion repository
Data:  
To: pcre-svn
Oggetto: [Pcre-svn] [1076] code/trunk: Try to fix CMake old policy warning issue.
Revision: 1076
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1076
Author:   ph10
Date:     2019-02-16 11:58:37 +0000 (Sat, 16 Feb 2019)
Log Message:
-----------
Try to fix CMake old policy warning issue.


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


Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt    2019-02-14 16:07:14 UTC (rev 1075)
+++ code/trunk/CMakeLists.txt    2019-02-16 11:58:37 UTC (rev 1076)
@@ -84,15 +84,17 @@
 # 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

 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${PROJECT_SOURCE_DIR}/src")
@@ -647,15 +649,28 @@
     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
#

Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2019-02-14 16:07:14 UTC (rev 1075)
+++ code/trunk/ChangeLog    2019-02-16 11:58:37 UTC (rev 1076)
@@ -133,7 +133,14 @@


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
-------------------------------