diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-10-22 16:51:51 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-10-24 06:42:04 (GMT) |
commit | 816b4a8a18b85c52529fc9cef4b20ad6af654734 (patch) | |
tree | 667f753dc4cd7117a388c55acf509d714423d959 /Source/cmTarget.cxx | |
parent | 030800a78a98035a1cfd95a148395bb2c442d650 (diff) | |
download | CMake-816b4a8a18b85c52529fc9cef4b20ad6af654734.zip CMake-816b4a8a18b85c52529fc9cef4b20ad6af654734.tar.gz CMake-816b4a8a18b85c52529fc9cef4b20ad6af654734.tar.bz2 |
cmTarget: Make consistentProperty return consistent content.
Upcoming features will make use of that.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f84095c..fc70d16 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -4452,7 +4452,7 @@ const char *getTypedProperty<const char *>(cmTarget *tgt, const char *prop, //---------------------------------------------------------------------------- template<typename PropertyType> -bool consistentProperty(PropertyType lhs, PropertyType rhs); +PropertyType consistentProperty(PropertyType lhs, PropertyType rhs); //---------------------------------------------------------------------------- template<> @@ -4463,13 +4463,21 @@ bool consistentProperty(bool lhs, bool rhs) //---------------------------------------------------------------------------- template<> -bool consistentProperty(const char *lhs, const char *rhs) +const char* consistentProperty(const char *lhs, const char *rhs) { if (!lhs && !rhs) - return true; - if (!lhs || !rhs) - return false; - return strcmp(lhs, rhs) == 0; + { + return ""; + } + if (!lhs) + { + return rhs ? rhs : ""; + } + if (!rhs) + { + return lhs ? lhs : ""; + } + return strcmp(lhs, rhs) == 0 ? lhs : 0; } template<typename PropertyType> |