summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-09-10 20:58:04 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-09-11 16:30:46 (GMT)
commit08ce3f486e789275104a390d2d34f36a90c5fd2f (patch)
tree1fae913a063920f9613a62149a2ff366799246ff
parent8e8824149fb6525f1a6da5f9c825a67765ce240b (diff)
downloadCMake-08ce3f486e789275104a390d2d34f36a90c5fd2f.zip
CMake-08ce3f486e789275104a390d2d34f36a90c5fd2f.tar.gz
CMake-08ce3f486e789275104a390d2d34f36a90c5fd2f.tar.bz2
cmTarget: Only append non-empty values to buildsystem properties.
This is a change in behavior from CMake 3.3, but there is no semantic meaning to empty entries in buildsystem properties. This also restores behavior to that of CMake 2.8.10.
-rw-r--r--Source/cmTarget.cxx10
-rw-r--r--Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt2
-rw-r--r--Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt2
-rw-r--r--Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt2
-rw-r--r--Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt2
-rw-r--r--Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt2
6 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3425f34..2dfa19c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1706,7 +1706,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "INCLUDE_DIRECTORIES")
{
- if (value)
+ if (value && *value)
{
this->Internal->IncludeDirectoriesEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@@ -1715,7 +1715,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "COMPILE_OPTIONS")
{
- if (value)
+ if (value && *value)
{
this->Internal->CompileOptionsEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@@ -1724,7 +1724,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "COMPILE_FEATURES")
{
- if (value)
+ if (value && *value)
{
this->Internal->CompileFeaturesEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@@ -1733,7 +1733,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if(prop == "COMPILE_DEFINITIONS")
{
- if (value)
+ if (value && *value)
{
this->Internal->CompileDefinitionsEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@@ -1749,7 +1749,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
}
else if (prop == "LINK_LIBRARIES")
{
- if (value)
+ if (value && *value)
{
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmValueWithOrigin entry(value, lfbt);
diff --git a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt
index b85f41d..186fe99 100644
--- a/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt
+++ b/Tests/RunCMake/set_property/COMPILE_DEFINITIONS-stdout.txt
@@ -1 +1 @@
--- Target COMPILE_DEFINITIONS is 'a;;b;c;;d;;e'
+-- Target COMPILE_DEFINITIONS is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt b/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt
index 81ef170..bd5a992 100644
--- a/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt
+++ b/Tests/RunCMake/set_property/COMPILE_FEATURES-stdout.txt
@@ -1 +1 @@
--- Target COMPILE_FEATURES is 'a;;b;c;;d;;e'
+-- Target COMPILE_FEATURES is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt b/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt
index f18451a..65d6934 100644
--- a/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt
+++ b/Tests/RunCMake/set_property/COMPILE_OPTIONS-stdout.txt
@@ -1 +1 @@
--- Target COMPILE_OPTIONS is 'a;;b;c;;d;;e'
+-- Target COMPILE_OPTIONS is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt
index f9970ce..955bdf2 100644
--- a/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt
+++ b/Tests/RunCMake/set_property/INCLUDE_DIRECTORIES-stdout.txt
@@ -1 +1 @@
--- Target INCLUDE_DIRECTORIES is 'a;;b;c;;d;;e'
+-- Target INCLUDE_DIRECTORIES is 'a;b;c;d;;e'
diff --git a/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt b/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt
index 1f7663b..9a3988e 100644
--- a/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt
+++ b/Tests/RunCMake/set_property/LINK_LIBRARIES-stdout.txt
@@ -1 +1 @@
--- Target LINK_LIBRARIES is 'a;;b;c;;d;;e'
+-- Target LINK_LIBRARIES is 'a;b;c;d;;e'