Steve,

The topic merged here:

 Merge topic 'use-generator-target'
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6e5953e9

regressed handling of the buildsystem-aware properties.
I fixed some of the problems and added test cases.  Please
see these commits:

 cmTarget: Fix buildsystem property empty value set and append operations
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf74fc24

 cmTarget: Fix memory leak when SOURCES property is cleared
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=407ff47e

 Tests: Cover set_property for buildsystem target properties
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9856862

However, additional problems remain.  I've attached updates
to the test suite that demonstrate the failures.  The problem
is distinguishing an appended empty value from the empty
sentinel values used in cmState.

As shown by the USER_PROP test cases added above and in the
attached patch, the behavior for non-buildsystem properties
is to never append empty values.  That was changed at some
point in the past for buildsystem property values when we
started recording internal data structures to store them.
One possible fix to the problems is to avoid allowing empty
values to be appended at all as is done for non-buildsystem
properties.  However, we still need to support setting a
property to exactly the empty string.

Please take a look.

Thanks,
-Brad

>From ee687230cecde7af9a3dd94c2b46bd634680baa4 Mon Sep 17 00:00:00 2001
Message-Id: <ee687230cecde7af9a3dd94c2b46bd634680baa4.1441809187.git.brad.k...@kitware.com>
From: Brad King <brad.k...@kitware.com>
Date: Wed, 2 Sep 2015 16:38:19 -0400
Subject: [PATCH] Tests: Cover set_property for buildsystem directory
 properties

Extend the RunCMake.set_property test with cases covering buildsystem
directory properties:

* COMPILE_DEFINITIONS
* COMPILE_OPTIONS
* INCLUDE_DIRECTORIES

Also test a non-buildsystem property to document the current difference
in behavior.  Use the output generated by CMake 3.3 as the expected
output for each test case.
---
 Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt |  1 +
 Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake      |  1 +
 Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt     |  1 +
 Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake          |  1 +
 Tests/RunCMake/set_property/Common.cmake                   | 14 ++++++++++++++
 Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt |  1 +
 Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake      |  1 +
 Tests/RunCMake/set_property/USER_PROP-stdout.txt           |  1 +
 Tests/RunCMake/set_property/USER_PROP.cmake                |  1 +
 9 files changed, 22 insertions(+)

diff --git a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt
index b85f41d..1b9f968 100644
--- a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt
+++ b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt
@@ -1 +1,2 @@
 -- Target COMPILE_DEFINITIONS is 'a;;b;c;;d;;e'
+-- Directory COMPILE_DEFINITIONS is 'a;;b;c;;d;;e'
diff --git a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake
index ec07ce9..f0c63bf 100644
--- a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake
+++ b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS.cmake
@@ -1,2 +1,3 @@
 include(Common.cmake)
 test_target_property(COMPILE_DEFINITIONS)
+test_directory_property(COMPILE_DEFINITIONS)
diff --git a/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt b/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt
index f18451a..32c9005 100644
--- a/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt
+++ b/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt
@@ -1 +1,2 @@
 -- Target COMPILE_OPTIONS is 'a;;b;c;;d;;e'
+-- Directory COMPILE_OPTIONS is 'a;;b;c;;d;;e'
diff --git a/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake b/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake
index da20ec8..75f0535 100644
--- a/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake
+++ b/Tests/RunCMake/set_property/COMPILE_OPTIONS.cmake
@@ -1,2 +1,3 @@
 include(Common.cmake)
 test_target_property(COMPILE_OPTIONS)
+test_directory_property(COMPILE_OPTIONS)
diff --git a/Tests/RunCMake/set_property/Common.cmake b/Tests/RunCMake/set_property/Common.cmake
index b359487..9d5e4f4 100644
--- a/Tests/RunCMake/set_property/Common.cmake
+++ b/Tests/RunCMake/set_property/Common.cmake
@@ -12,3 +12,17 @@ macro(test_target_property PROP)
   message(STATUS "Target ${PROP} is '${val}'")
   set_property(TARGET CustomTarget PROPERTY ${PROP})
 endmacro()
+
+macro(test_directory_property PROP)
+  set_property(DIRECTORY PROPERTY ${PROP} x)
+  set_property(DIRECTORY PROPERTY ${PROP})
+  set_property(DIRECTORY APPEND PROPERTY ${PROP})
+  set_property(DIRECTORY PROPERTY ${PROP} a)
+  set_property(DIRECTORY APPEND PROPERTY ${PROP} "")
+  set_property(DIRECTORY APPEND PROPERTY ${PROP} b c)
+  set_property(DIRECTORY APPEND PROPERTY ${PROP})
+  set_property(DIRECTORY APPEND PROPERTY ${PROP} "d;;e")
+  get_property(val DIRECTORY PROPERTY ${PROP})
+  message(STATUS "Directory ${PROP} is '${val}'")
+  set_property(DIRECTORY PROPERTY ${PROP})
+endmacro()
diff --git a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt
index f9970ce..938b9f9 100644
--- a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt
+++ b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt
@@ -1 +1,2 @@
 -- Target INCLUDE_DIRECTORIES is 'a;;b;c;;d;;e'
+-- Directory INCLUDE_DIRECTORIES is 'a;;b;c;;d;;e'
diff --git a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake
index 8f44aee..c9a9151 100644
--- a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake
+++ b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES.cmake
@@ -1,2 +1,3 @@
 include(Common.cmake)
 test_target_property(INCLUDE_DIRECTORIES)
+test_directory_property(INCLUDE_DIRECTORIES)
diff --git a/Tests/RunCMake/set_property/USER_PROP-stdout.txt b/Tests/RunCMake/set_property/USER_PROP-stdout.txt
index eaf6e37..107cc87 100644
--- a/Tests/RunCMake/set_property/USER_PROP-stdout.txt
+++ b/Tests/RunCMake/set_property/USER_PROP-stdout.txt
@@ -1 +1,2 @@
 -- Target USER_PROP is 'a;b;c;d;;e'
+-- Directory USER_PROP is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/USER_PROP.cmake b/Tests/RunCMake/set_property/USER_PROP.cmake
index e1f88e1..aa0aa83 100644
--- a/Tests/RunCMake/set_property/USER_PROP.cmake
+++ b/Tests/RunCMake/set_property/USER_PROP.cmake
@@ -1,2 +1,3 @@
 include(Common.cmake)
 test_target_property(USER_PROP)
+test_directory_property(USER_PROP)
-- 
2.5.0


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to