ENH: some more cleanup
This commit is contained in:
parent
5891ba16ce
commit
c53b26baf2
|
@ -73,13 +73,13 @@ bool cmAddCustomTargetCommand::InitialPass(
|
|||
tdoing doing = doing_command;
|
||||
|
||||
// Look for the ALL option.
|
||||
bool all = false;
|
||||
bool excludeFromAll = true;
|
||||
unsigned int start = 1;
|
||||
if(args.size() > 1)
|
||||
{
|
||||
if(args[1] == "ALL")
|
||||
{
|
||||
all = true;
|
||||
excludeFromAll = false;
|
||||
start = 2;
|
||||
}
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ bool cmAddCustomTargetCommand::InitialPass(
|
|||
|
||||
// Add the utility target to the makefile.
|
||||
bool escapeOldStyle = !verbatim;
|
||||
this->Makefile->AddUtilityCommand(args[0].c_str(), all,
|
||||
this->Makefile->AddUtilityCommand(args[0].c_str(), excludeFromAll,
|
||||
working_directory.c_str(), depends,
|
||||
commandLines, escapeOldStyle, comment);
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ void CCONV cmAddUtilityCommand(void *arg, const char* utilityName,
|
|||
}
|
||||
|
||||
// Pass the call to the makefile instance.
|
||||
mf->AddUtilityCommand(utilityName, (all ? true : false),
|
||||
mf->AddUtilityCommand(utilityName, (all ? false : true),
|
||||
0, depends2, commandLines);
|
||||
}
|
||||
void CCONV cmAddCustomCommand(void *arg, const char* source,
|
||||
|
|
|
@ -171,7 +171,7 @@ void cmGlobalVisualStudio6Generator::Generate()
|
|||
// add the ALL_BUILD to the first local generator of each project
|
||||
if(gen.size())
|
||||
{
|
||||
gen[0]->GetMakefile()->AddUtilityCommand("ALL_BUILD", false,
|
||||
gen[0]->GetMakefile()->AddUtilityCommand("ALL_BUILD", true,
|
||||
no_depends,
|
||||
no_working_dir,
|
||||
"echo", "Build all projects");
|
||||
|
|
|
@ -226,7 +226,7 @@ void cmGlobalVisualStudio7Generator::Generate()
|
|||
if(gen.size())
|
||||
{
|
||||
gen[0]->GetMakefile()->
|
||||
AddUtilityCommand("ALL_BUILD", false, no_depends,
|
||||
AddUtilityCommand("ALL_BUILD", true, no_depends,
|
||||
no_working_dir,
|
||||
"echo", "Build all projects");
|
||||
std::string cmake_command =
|
||||
|
|
|
@ -91,7 +91,7 @@ void cmGlobalVisualStudio8Generator::Generate()
|
|||
cmMakefile* mf = lg->GetMakefile();
|
||||
std::string cmake_command = mf->GetRequiredDefinition("CMAKE_COMMAND");
|
||||
cmCustomCommandLines noCommandLines;
|
||||
mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, true,
|
||||
mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false,
|
||||
no_working_directory, no_depends,
|
||||
noCommandLines);
|
||||
cmTarget* tgt = mf->FindTarget(CMAKE_CHECK_BUILD_SYSTEM_TARGET);
|
||||
|
|
|
@ -252,7 +252,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|||
// Add ALL_BUILD
|
||||
const char* no_working_directory = 0;
|
||||
std::vector<std::string> no_depends;
|
||||
mf->AddUtilityCommand("ALL_BUILD", false, no_depends,
|
||||
mf->AddUtilityCommand("ALL_BUILD", true, no_depends,
|
||||
no_working_directory,
|
||||
"echo", "Build all projects");
|
||||
cmTarget* allbuild = mf->FindTarget("ALL_BUILD");
|
||||
|
@ -275,7 +275,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|||
}
|
||||
cmCustomCommandLines commandLines;
|
||||
commandLines.push_back(makecommand);
|
||||
mf->AddUtilityCommand("XCODE_DEPEND_HELPER", false,
|
||||
mf->AddUtilityCommand("XCODE_DEPEND_HELPER", true,
|
||||
no_working_directory,
|
||||
no_depends,
|
||||
commandLines);
|
||||
|
|
|
@ -771,7 +771,8 @@ cmMakefile::AddCustomCommandOldStyle(const char* target,
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
|
||||
void cmMakefile::AddUtilityCommand(const char* utilityName,
|
||||
bool excludeFromAll,
|
||||
const std::vector<std::string>& depends,
|
||||
const char* workingDirectory,
|
||||
const char* command,
|
||||
|
@ -803,12 +804,13 @@ void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
|
|||
commandLines.push_back(commandLine);
|
||||
|
||||
// Call the real signature of this method.
|
||||
this->AddUtilityCommand(utilityName, all, workingDirectory,
|
||||
this->AddUtilityCommand(utilityName, excludeFromAll, workingDirectory,
|
||||
depends, commandLines);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
|
||||
void cmMakefile::AddUtilityCommand(const char* utilityName,
|
||||
bool excludeFromAll,
|
||||
const char* workingDirectory,
|
||||
const std::vector<std::string>& depends,
|
||||
const cmCustomCommandLines& commandLines,
|
||||
|
@ -818,8 +820,10 @@ void cmMakefile::AddUtilityCommand(const char* utilityName, bool all,
|
|||
cmTarget target;
|
||||
target.SetMakefile(this);
|
||||
target.SetType(cmTarget::UTILITY, utilityName);
|
||||
target.SetProperty("EXCLUDE_FROM_ALL", (all) ?"FALSE" : "TRUE");
|
||||
|
||||
if (excludeFromAll)
|
||||
{
|
||||
target.SetProperty("EXCLUDE_FROM_ALL", "TRUE");
|
||||
}
|
||||
if(!comment)
|
||||
{
|
||||
// Use an empty comment to avoid generation of default comment.
|
||||
|
|
|
@ -176,7 +176,7 @@ public:
|
|||
* Add a utility to the build. A utiltity target is a command that
|
||||
* is run every time the target is built.
|
||||
*/
|
||||
void AddUtilityCommand(const char* utilityName, bool all,
|
||||
void AddUtilityCommand(const char* utilityName, bool excludeFromAll,
|
||||
const std::vector<std::string>& depends,
|
||||
const char* workingDirectory,
|
||||
const char* command,
|
||||
|
@ -184,7 +184,7 @@ public:
|
|||
const char* arg2=0,
|
||||
const char* arg3=0,
|
||||
const char* arg4=0);
|
||||
void AddUtilityCommand(const char* utilityName, bool all,
|
||||
void AddUtilityCommand(const char* utilityName, bool excludeFromAll,
|
||||
const char* workingDirectory,
|
||||
const std::vector<std::string>& depends,
|
||||
const cmCustomCommandLines& commandLines,
|
||||
|
|
Loading…
Reference in New Issue