From edc738173b8a50e65557ea0fc237a3432621aa3a Mon Sep 17 00:00:00 2001 From: Sebastien Barre Date: Sun, 19 Aug 2001 19:11:59 -0400 Subject: Allow option value to be expanded (thus, we can use the value of another option as default) --- Source/cmOptionCommand.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index db3c007..3e167de 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -55,13 +55,14 @@ bool cmOptionCommand::InitialPass(std::vector& args) = m_Makefile->GetDefinition(args[0].c_str()); if(!cacheValue) { - const char* initialValue = "Off"; + std::string initialValue = "Off"; if(args.size() == 3) { - initialValue = args[2].c_str(); + initialValue = args[2]; + m_Makefile->ExpandVariablesInString(initialValue); } m_Makefile->AddCacheDefinition(args[0].c_str(), - cmSystemTools::IsOn(initialValue), + cmSystemTools::IsOn(initialValue.c_str()), args[1].c_str()); } else -- cgit v0.12