Expand vars in exe and lib name

This commit is contained in:
Sebastien Barre 2001-11-01 13:09:08 -05:00
parent 10ae8a4e24
commit 63cb6c7407
2 changed files with 13 additions and 5 deletions

View File

@ -51,17 +51,21 @@ bool cmAddExecutableCommand::InitialPass(std::vector<std::string> const& args)
} }
std::vector<std::string>::const_iterator s = args.begin(); std::vector<std::string>::const_iterator s = args.begin();
std::string exename = *s;
m_Makefile->ExpandVariablesInString(exename);
++s; ++s;
if (*s == "WIN32") if (*s == "WIN32")
{ {
++s; ++s;
std::vector<std::string> srclists(s, args.end()); std::vector<std::string> srclists(s, args.end());
m_Makefile->AddExecutable(args[0].c_str(),srclists, true); m_Makefile->AddExecutable(exename.c_str(),srclists, true);
} }
else else
{ {
std::vector<std::string> srclists(s, args.end()); std::vector<std::string> srclists(s, args.end());
m_Makefile->AddExecutable(args[0].c_str(),srclists, false); m_Makefile->AddExecutable(exename.c_str(),srclists, false);
} }
return true; return true;

View File

@ -49,12 +49,16 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args)
this->SetError("called with incorrect number of arguments"); this->SetError("called with incorrect number of arguments");
return false; return false;
} }
// Library type defaults to value of BUILD_SHARED_LIBS, if it exists, // Library type defaults to value of BUILD_SHARED_LIBS, if it exists,
// otherwise it defaults to static library. // otherwise it defaults to static library.
int shared = !cmSystemTools::IsOff(m_Makefile->GetDefinition("BUILD_SHARED_LIBS")); int shared = !cmSystemTools::IsOff(m_Makefile->GetDefinition("BUILD_SHARED_LIBS"));
std::vector<std::string>::const_iterator s = args.begin(); std::vector<std::string>::const_iterator s = args.begin();
std::string libname = *s;
m_Makefile->ExpandVariablesInString(libname);
++s; ++s;
// If the second argument is "SHARED" or "STATIC", then it controls // If the second argument is "SHARED" or "STATIC", then it controls
@ -81,8 +85,8 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args)
} }
} }
std::vector<std::string> srclists(s, args.end()); std::vector<std::string> srclists(s, args.end());
m_Makefile->AddLibrary(args[0].c_str(), shared, srclists); m_Makefile->AddLibrary(libname.c_str(), shared, srclists);
return true; return true;
} }