diff options
Diffstat (limited to 'Source/cmOptionCommand.cxx')
-rw-r--r-- | Source/cmOptionCommand.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 22e59ac43..a58e2f8cc 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -6,6 +6,7 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" +#include "cmProperty.h" #include "cmState.h" #include "cmStateSnapshot.h" #include "cmStateTypes.h" @@ -52,7 +53,7 @@ bool cmOptionCommand(std::vector<std::string> const& args, // See if a cache variable with this name already exists // If so just make sure the doc state is correct cmState* state = status.GetMakefile().GetState(); - const char* existingValue = state->GetCacheEntryValue(args[0]); + cmProp existingValue = state->GetCacheEntryValue(args[0]); if (existingValue && (state->GetCacheEntryType(args[0]) != cmStateEnums::UNINITIALIZED)) { state->SetCacheEntryProperty(args[0], "HELPSTRING", args[1]); @@ -60,7 +61,7 @@ bool cmOptionCommand(std::vector<std::string> const& args, } // Nothing in the cache so add it - std::string initialValue = existingValue ? existingValue : "Off"; + std::string initialValue = existingValue ? *existingValue : "Off"; if (args.size() == 3) { initialValue = args[2]; } |