summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2022-03-19 06:03:26 (GMT)
committerCraig Scott <craig.scott@crascit.com>2022-03-19 06:33:45 (GMT)
commit87c3b5e421b3f39d52caa113da4b577c6b68fa03 (patch)
tree90bc6108ed8ffe4addaaccb855dab3b89bc153a2 /Source
parent9b50f221f6208a9dc3a993ddd4ceca21382bcf44 (diff)
downloadCMake-87c3b5e421b3f39d52caa113da4b577c6b68fa03.zip
CMake-87c3b5e421b3f39d52caa113da4b577c6b68fa03.tar.gz
CMake-87c3b5e421b3f39d52caa113da4b577c6b68fa03.tar.bz2
define_property(): Only test prefix if INITIALIZE_FROM_VARIABLE is given
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDefinePropertyCommand.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmDefinePropertyCommand.cxx b/Source/cmDefinePropertyCommand.cxx
index 7a2f34f..15b2652 100644
--- a/Source/cmDefinePropertyCommand.cxx
+++ b/Source/cmDefinePropertyCommand.cxx
@@ -97,20 +97,20 @@ bool cmDefinePropertyCommand(std::vector<std::string> const& args,
PropertyName, "\""));
return false;
}
- }
- // Make sure the variable is not reserved.
- static constexpr const char* reservedPrefixes[] = {
- "CMAKE_",
- "_CMAKE_",
- };
- if (std::any_of(std::begin(reservedPrefixes), std::end(reservedPrefixes),
- [&initializeFromVariable](const char* prefix) {
- return cmHasPrefix(initializeFromVariable, prefix);
- })) {
- status.SetError(
- cmStrCat("variable name \"", initializeFromVariable, "\" is reserved"));
- return false;
+ // Make sure the variable is not reserved.
+ static constexpr const char* reservedPrefixes[] = {
+ "CMAKE_",
+ "_CMAKE_",
+ };
+ if (std::any_of(std::begin(reservedPrefixes), std::end(reservedPrefixes),
+ [&initializeFromVariable](const char* prefix) {
+ return cmHasPrefix(initializeFromVariable, prefix);
+ })) {
+ status.SetError(cmStrCat("variable name \"", initializeFromVariable,
+ "\" is reserved"));
+ return false;
+ }
}
// Actually define the property.