summaryrefslogtreecommitdiffstats
path: root/Source/cmPolicies.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-06-28 14:37:39 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-11 19:17:27 (GMT)
commite4e5b28c27dc2e6f0073e11fb64c4ea62022a051 (patch)
treeba7aa13e6521fcf786811b9679b23269a11e5d36 /Source/cmPolicies.cxx
parent7e4910fe47d667e059e42ac6395b0f4726f17064 (diff)
downloadCMake-e4e5b28c27dc2e6f0073e11fb64c4ea62022a051.zip
CMake-e4e5b28c27dc2e6f0073e11fb64c4ea62022a051.tar.gz
CMake-e4e5b28c27dc2e6f0073e11fb64c4ea62022a051.tar.bz2
cmTarget: Deprecate the LOCATION target property with a policy.
The final location and name of a build-target is not determined until generate-time. However, reading the LOCATION property from a target is currently allowed at configure time. Apart from creating possibly-erroneous results, this has an impact on the implementation of cmake itself, and prevents some major cleanups from being made. Disallow reading LOCATION from build-targets with a policy. Port some existing uses of it in CMake itself to use the TARGET_FILE generator expression.
Diffstat (limited to 'Source/cmPolicies.cxx')
-rw-r--r--Source/cmPolicies.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 1d3469f..d07645c 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -637,6 +637,28 @@ cmPolicies::cmPolicies()
"The OLD behavior for this policy is to use compiler id \"Clang\". "
"The NEW behavior for this policy is to use compiler id \"AppleClang\".",
2,8,13,0, cmPolicies::WARN);
+
+ this->DefinePolicy(
+ CMP0026, "CMP0026",
+ "Disallow use of the LOCATION target property.",
+ "CMake 2.8.12 and lower allowed reading the LOCATION target property to "
+ "determine the eventual location of build targets. This relies on the "
+ "assumption that all necessary information is available at "
+ "configure-time to determine the final location and filename of the "
+ "target. However, this property is not fully determined until later at "
+ "generate-time. At generate time, the $<TARGET_FILE> generator "
+ "expression can be used to determine the eventual LOCATION of a target "
+ "output."
+ "\n"
+ "Code which reads the LOCATION target property can be ported to use the "
+ "$<TARGET_FILE> generator expression together with the file(GENERATE) "
+ "subcommand to generate a file containing the target location."
+ "\n"
+ "The OLD behavior for this policy is to allow reading the LOCATION "
+ "property from build-targets. "
+ "The NEW behavior for this policy is to not to allow reading the "
+ "LOCATION property from build-targets.",
+ 2,8,13,0, cmPolicies::WARN);
}
cmPolicies::~cmPolicies()