diff options
author | Brad King <brad.king@kitware.com> | 2016-06-02 14:57:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-02 14:58:38 (GMT) |
commit | f500a784d008566d6eb6301b7c6a0f07847b856d (patch) | |
tree | 6d8fbe3bbad0ea13517ef0a029e373486523fb53 /Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION-stderr.txt | |
parent | 9d81f1b3aaa82d12a3a87067572b3ff5e2b9c4d2 (diff) | |
download | CMake-f500a784d008566d6eb6301b7c6a0f07847b856d.zip CMake-f500a784d008566d6eb6301b7c6a0f07847b856d.tar.gz CMake-f500a784d008566d6eb6301b7c6a0f07847b856d.tar.bz2 |
Fix crash on $<TARGET_PROPERTY:...,LOCATION> genex (#16134)
Policy CMP0026 deprecated the LOCATION property, and we have long
provided a $<TARGET_FILE:...> generator expression. However, if
a project tries to use $<TARGET_PROPERTY:...,LOCATION> we should
at least not crash.
The compatibility implementation of the LOCATION property uses
cmGlobalGenerator::CreateGenerationObjects to create the structures
needed to evaluate the property before generation starts. The
implementation assumed that accessing the property could only be done
during configuration (via the typical get_property command use case).
The $<TARGET_PROPERTY:...,LOCATION> genex causes the LOCATION property
to be accessed during generation. Calling CreateGenerationObjects
during generation blows away all the objects currently being used for
generation and is not safe. Add a condition to call it only when
configuration is not finished.
Diffstat (limited to 'Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION-stderr.txt')
-rw-r--r-- | Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION-stderr.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION-stderr.txt b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION-stderr.txt new file mode 100644 index 0000000..e4dbb71 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-LOCATION-stderr.txt @@ -0,0 +1,10 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0026 is not set: Disallow use of the LOCATION target property. + Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The LOCATION property should not be read from target "foo". Use the target + name directly with add_custom_command, or use the generator expression + \$<TARGET_FILE>, as appropriate. + +This warning is for project developers. Use -Wno-dev to suppress it. |