diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-03-21 20:34:15 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2022-03-23 05:39:32 (GMT) |
commit | 26caa97057445232ce50d4e1de1dff219ae5826b (patch) | |
tree | 2ae9c119648f9761aa383e6a6d4245760ec68b6c /Source/cmDefinePropertyCommand.cxx | |
parent | 2aad4cef979bd5174f067424a117fac765e3da34 (diff) | |
download | CMake-26caa97057445232ce50d4e1de1dff219ae5826b.zip CMake-26caa97057445232ce50d4e1de1dff219ae5826b.tar.gz CMake-26caa97057445232ce50d4e1de1dff219ae5826b.tar.bz2 |
define_property(): Change constraints of INITIALIZE_FROM_VARIABLE
Remove the requirement that the variable name have a prefix while
keeping the suffix requirement. Require that the property name
contains an underscore. Update docs and tests accordingly.
Fixes: #23340
Diffstat (limited to 'Source/cmDefinePropertyCommand.cxx')
-rw-r--r-- | Source/cmDefinePropertyCommand.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx index 15b2652..faefcb8 100644 --- a/Source/cmDefinePropertyCommand.cxx +++ b/Source/cmDefinePropertyCommand.cxx @@ -91,10 +91,10 @@ bool cmDefinePropertyCommand(std::vector<std::string> const& args, PropertyName, "\"")); return false; } - if (initializeFromVariable == PropertyName) { - status.SetError(cmStrCat( - "Variable name must have a non-empty prefix before property name \"", - PropertyName, "\"")); + if (PropertyName.find('_') == std::string::npos) { + status.SetError(cmStrCat("Property name \"", PropertyName, + "\" defined with INITIALIZE_FROM_VARIABLE does " + "not contain underscore")); return false; } |