apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Schlenker <Michael.Schlen...@contact-software.com>
Subject Small patch to silence CMake warning CMP0026 LOCATION when building apr 1.6.x
Date Wed, 22 Mar 2017 16:35:27 GMT
Hi,

just a small patch against the apr 1.6.x  branch to silence the CMP0026 Warning when running
CMake.

Removes this Warning:

CMake Warning (dev) at CMakeLists.txt:52 (GET_TARGET_PROPERTY):
  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The LOCATION property should not be read from target "gen_test_char".  Use
  the target name directly with add_custom_command, or use the generator
  expression $<TARGET_FILE>, as appropriate.

This warning is for project developers.  Use -Wno-dev to suppress it.


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (Revision 1788130)
+++ CMakeLists.txt      (Arbeitskopie)
@@ -49,11 +49,10 @@
                ${PROJECT_BINARY_DIR}/apr.h)

 ADD_EXECUTABLE(gen_test_char tools/gen_test_char.c)
-GET_TARGET_PROPERTY(GEN_TEST_CHAR_EXE gen_test_char LOCATION)
 ADD_CUSTOM_COMMAND(
   COMMENT "Generating character tables, apr_escape_test_char.h, for current locale"
   DEPENDS gen_test_char
-  COMMAND ${GEN_TEST_CHAR_EXE} > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h
+  COMMAND "$<TARGET_FILE:gen_test_char>" > ${PROJECT_BINARY_DIR}/apr_escape_test_char.h
   OUTPUT ${PROJECT_BINARY_DIR}/apr_escape_test_char.h
 )
 ADD_CUSTOM_TARGET(


----
Michael Schlenker
Senior Software Engineer

CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
Wiener Stra├če 1-3               Fax:    +49 (421) 20153-41
28359 Bremen                    
E-Mail: michael.schlenker@contact-software.com
http://www.contact-software.com/

Registered office: Bremen, Germany
Managing directors: Karl Heinz Zachries, Ralf Holtgrefe
Court of register: Amtsgericht Bremen HRB 13215



Mime
View raw message