summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-06-17 17:40:09 (GMT)
committerBrad King <brad.king@kitware.com>2009-06-17 17:40:09 (GMT)
commitc790b1fabbc7b160bd67e1654a34964fd897a36c (patch)
tree35af1a3c2f59d02c85f3fd1908b9fbde32b0e75c /Source/cmPolicies.cxx
parentf61f8e538383ee632aafc7ac74cd1d118288b310 (diff)
downloadCMake-c790b1fabbc7b160bd67e1654a34964fd897a36c.zip
CMake-c790b1fabbc7b160bd67e1654a34964fd897a36c.tar.gz
CMake-c790b1fabbc7b160bd67e1654a34964fd897a36c.tar.bz2
ENH: Create CMP0013 to disallow duplicate dirs
In CMake 2.6.3 and below we silently accepted duplicate build directories whose build files would then conflict. At first this was considured purely a bug that confused beginners but would not be used in a real project. In CMake 2.6.4 we explicitly made it an error. However, some real projects took advantage of this as a "feature" and got lucky that the subtle build errors it can cause did not occur. Therefore we need a policy to deal with the case more gracefully. See issue #9173.
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r--Source/cmPolicies.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 5e80e2f..1f8bb89 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -369,6 +369,23 @@ cmPolicies::cmPolicies()
"The NEW behavior for this policy is to treat strings like true as a "
"boolean constant.",
2,6,5, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0013, "CMP0013",
+ "Duplicate binary directories are not allowed.",
+ "CMake 2.6.3 and below silently permitted add_subdirectory() calls "
+ "to create the same binary directory multiple times. "
+ "During build system generation files would be written and then "
+ "overwritten in the build tree and could lead to strange behavior. "
+ "CMake 2.6.4 and above explicitly detect duplicate binary directories. "
+ "CMake 2.6.4 always considers this case an error. "
+ "In CMake 2.6.5 and above this policy determines whether or not "
+ "the case is an error. "
+ "The OLD behavior for this policy is to allow duplicate binary "
+ "directories. "
+ "The NEW behavior for this policy is to disallow duplicate binary "
+ "directories with an error.",
+ 2,6,5, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()