ENH: make CMake less verbose/precious
This commit is contained in:
parent
bf228b05c7
commit
d774cd7c2b
|
@ -225,23 +225,30 @@ void cmNMakeMakefileGenerator::OutputMakeVariables(std::ostream& fout)
|
||||||
|
|
||||||
|
|
||||||
void cmNMakeMakefileGenerator::BuildInSubDirectory(std::ostream& fout,
|
void cmNMakeMakefileGenerator::BuildInSubDirectory(std::ostream& fout,
|
||||||
const char* directory,
|
const char* directory,
|
||||||
const char* target1,
|
const char* target1,
|
||||||
const char* target2)
|
const char* target2,
|
||||||
|
bool silent)
|
||||||
{
|
{
|
||||||
if(target1)
|
if(target1)
|
||||||
{
|
{
|
||||||
std::string dir = this->ConvertToOutputPath(directory);
|
std::string dir = this->ConvertToOutputPath(directory);
|
||||||
fout << "\tif not exist \"" << dir << "\\$(NULL)\""
|
fout << "\tif not exist \"" << dir << "\\$(NULL)\""
|
||||||
<< " "
|
<< " "
|
||||||
<< "$(MAKE) $(MAKESILENT) rebuild_cache\n"
|
<< "$(MAKE) $(MAKESILENT) rebuild_cache\n";
|
||||||
<< "\techo Building " << target1 << " in directory " << directory << "\n"
|
if (!silent)
|
||||||
<< "\tcd " << dir << "\n"
|
{
|
||||||
|
fout << "\techo Building " << target1 << " in directory " << directory << "\n";
|
||||||
|
}
|
||||||
|
fout << "\tcd " << dir << "\n"
|
||||||
<< "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) " << target1 << "\n";
|
<< "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) " << target1 << "\n";
|
||||||
}
|
}
|
||||||
if(target2)
|
if(target2)
|
||||||
{
|
{
|
||||||
fout << "\techo Building " << target2 << " in directory " << directory << "\n";
|
if (!silent)
|
||||||
|
{
|
||||||
|
fout << "\techo Building " << target2 << " in directory " << directory << "\n";
|
||||||
|
}
|
||||||
fout << "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) " << target2 << "\n";
|
fout << "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) " << target2 << "\n";
|
||||||
}
|
}
|
||||||
std::string currentDir = m_Makefile->GetCurrentOutputDirectory();
|
std::string currentDir = m_Makefile->GetCurrentOutputDirectory();
|
||||||
|
|
|
@ -49,7 +49,8 @@ protected:
|
||||||
virtual void BuildInSubDirectory(std::ostream& fout,
|
virtual void BuildInSubDirectory(std::ostream& fout,
|
||||||
const char* directory,
|
const char* directory,
|
||||||
const char* target1,
|
const char* target1,
|
||||||
const char* target2);
|
const char* target2,
|
||||||
|
bool silent = false);
|
||||||
void OutputMakeRule(std::ostream& fout,
|
void OutputMakeRule(std::ostream& fout,
|
||||||
const char* comment,
|
const char* comment,
|
||||||
const char* target,
|
const char* target,
|
||||||
|
|
|
@ -230,9 +230,9 @@ void cmUnixMakefileGenerator::OutputMakefile(const char* file)
|
||||||
"Default target executed when no arguments are given to make, first make sure cmake.depends exists, cmake.check_depends is up-to-date, check the sources, then build the all target",
|
"Default target executed when no arguments are given to make, first make sure cmake.depends exists, cmake.check_depends is up-to-date, check the sources, then build the all target",
|
||||||
"default_target",
|
"default_target",
|
||||||
0,
|
0,
|
||||||
"$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.depends",
|
"$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.depends > cmake.depends.out",
|
||||||
"$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.check_depends",
|
"$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.check_depends >> cmake.depends.out",
|
||||||
"$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) -f cmake.check_depends",
|
"$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) -f cmake.check_depends >> cmake.depends.out",
|
||||||
"$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) all");
|
"$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) all");
|
||||||
|
|
||||||
this->OutputTargetRules(fout);
|
this->OutputTargetRules(fout);
|
||||||
|
@ -1173,20 +1173,27 @@ inline std::string FixDirectoryName(const char* dir)
|
||||||
void cmUnixMakefileGenerator::BuildInSubDirectory(std::ostream& fout,
|
void cmUnixMakefileGenerator::BuildInSubDirectory(std::ostream& fout,
|
||||||
const char* dir,
|
const char* dir,
|
||||||
const char* target1,
|
const char* target1,
|
||||||
const char* target2)
|
const char* target2,
|
||||||
|
bool silent)
|
||||||
{
|
{
|
||||||
std::string directory = this->ConvertToOutputPath(dir);
|
std::string directory = this->ConvertToOutputPath(dir);
|
||||||
if(target1)
|
if(target1)
|
||||||
{
|
{
|
||||||
fout << "\t@if test ! -d " << directory
|
fout << "\t@if test ! -d " << directory
|
||||||
<< "; then $(MAKE) rebuild_cache; fi\n"
|
<< "; then $(MAKE) rebuild_cache; fi\n";
|
||||||
<< "\techo Building " << target1 << " in directory " << directory << "\n"
|
if (!silent)
|
||||||
<< "\t@cd " << directory
|
{
|
||||||
|
fout << "\techo Building " << target1 << " in directory " << directory << "\n";
|
||||||
|
}
|
||||||
|
fout << "\t@cd " << directory
|
||||||
<< "; $(MAKE) -$(MAKEFLAGS) " << target1 << "\n";
|
<< "; $(MAKE) -$(MAKEFLAGS) " << target1 << "\n";
|
||||||
}
|
}
|
||||||
if(target2)
|
if(target2)
|
||||||
{
|
{
|
||||||
fout << "\techo Building " << target2 << " in directory " << directory << "\n";
|
if (!silent)
|
||||||
|
{
|
||||||
|
fout << "\techo Building " << target2 << " in directory " << directory << "\n";
|
||||||
|
}
|
||||||
fout << "\t@cd " << directory
|
fout << "\t@cd " << directory
|
||||||
<< "; $(MAKE) -$(MAKEFLAGS) " << target2 << "\n";
|
<< "; $(MAKE) -$(MAKEFLAGS) " << target2 << "\n";
|
||||||
}
|
}
|
||||||
|
@ -1202,7 +1209,8 @@ OutputSubDirectoryVars(std::ostream& fout,
|
||||||
const char* target1,
|
const char* target1,
|
||||||
const char* target2,
|
const char* target2,
|
||||||
const char* depend,
|
const char* depend,
|
||||||
const std::vector<std::string>& SubDirectories)
|
const std::vector<std::string>& SubDirectories,
|
||||||
|
bool silent)
|
||||||
{
|
{
|
||||||
if(!depend)
|
if(!depend)
|
||||||
{
|
{
|
||||||
|
@ -1249,7 +1257,7 @@ OutputSubDirectoryVars(std::ostream& fout,
|
||||||
dir += "/";
|
dir += "/";
|
||||||
dir += SubDirectories[i];
|
dir += SubDirectories[i];
|
||||||
this->BuildInSubDirectory(fout, dir.c_str(),
|
this->BuildInSubDirectory(fout, dir.c_str(),
|
||||||
target1, target2);
|
target1, target2, silent);
|
||||||
}
|
}
|
||||||
fout << "\n\n";
|
fout << "\n\n";
|
||||||
}
|
}
|
||||||
|
@ -1271,7 +1279,8 @@ void cmUnixMakefileGenerator::OutputSubDirectoryRules(std::ostream& fout)
|
||||||
"default_target",
|
"default_target",
|
||||||
"default_target",
|
"default_target",
|
||||||
0, "$(TARGETS)",
|
0, "$(TARGETS)",
|
||||||
SubDirectories);
|
SubDirectories,
|
||||||
|
true);
|
||||||
this->OutputSubDirectoryVars(fout, "SUBDIR_CLEAN", "clean",
|
this->OutputSubDirectoryVars(fout, "SUBDIR_CLEAN", "clean",
|
||||||
"clean",
|
"clean",
|
||||||
0, 0,
|
0, 0,
|
||||||
|
|
|
@ -120,7 +120,8 @@ protected:
|
||||||
virtual void BuildInSubDirectory(std::ostream& fout,
|
virtual void BuildInSubDirectory(std::ostream& fout,
|
||||||
const char* directory,
|
const char* directory,
|
||||||
const char* target1,
|
const char* target1,
|
||||||
const char* target2);
|
const char* target2,
|
||||||
|
bool silent = false);
|
||||||
|
|
||||||
virtual void OutputSubDirectoryVars(std::ostream& fout,
|
virtual void OutputSubDirectoryVars(std::ostream& fout,
|
||||||
const char* var,
|
const char* var,
|
||||||
|
@ -129,7 +130,9 @@ protected:
|
||||||
const char* target2,
|
const char* target2,
|
||||||
const char* depend,
|
const char* depend,
|
||||||
const std::vector<std::string>&
|
const std::vector<std::string>&
|
||||||
SubDirectories);
|
SubDirectories,
|
||||||
|
bool silent = false);
|
||||||
|
|
||||||
virtual void OutputMakeRule(std::ostream&,
|
virtual void OutputMakeRule(std::ostream&,
|
||||||
const char* comment,
|
const char* comment,
|
||||||
const char* target,
|
const char* target,
|
||||||
|
|
Loading…
Reference in New Issue