You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Michael Schlenker <Mi...@contact-software.com> on 2017/03/22 16:35:27 UTC

Small patch to silence CMake warning CMP0026 LOCATION when building apr 1.6.x

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



AW: Small patch to silence CMake warning CMP0026 LOCATION when building apr 1.6.x

Posted by Michael Schlenker <Mi...@contact-software.com>.
Oops.

Just noticed the CMAKE 2.8 dependency. This only works for 3.x (which is just 3 years old...).

Michael

-----Ursprüngliche Nachricht-----
Von: Michael Schlenker [mailto:Michael.Schlenker@contact-software.com] 
Gesendet: Mittwoch, 22. März 2017 17:35
An: dev@apr.apache.org
Betreff: Small patch to silence CMake warning CMP0026 LOCATION when building apr 1.6.x

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