|
@@ -136,7 +136,7 @@ void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/,
|
|
cm->MarkCliAsUsed(variable);
|
|
cm->MarkCliAsUsed(variable);
|
|
}
|
|
}
|
|
|
|
|
|
-cmake::cmake()
|
|
|
|
|
|
+cmake::cmake(Role role)
|
|
{
|
|
{
|
|
this->Trace = false;
|
|
this->Trace = false;
|
|
this->TraceExpand = false;
|
|
this->TraceExpand = false;
|
|
@@ -174,8 +174,12 @@ cmake::cmake()
|
|
|
|
|
|
this->AddDefaultGenerators();
|
|
this->AddDefaultGenerators();
|
|
this->AddDefaultExtraGenerators();
|
|
this->AddDefaultExtraGenerators();
|
|
- this->AddScriptingCommands();
|
|
|
|
- this->AddProjectCommands();
|
|
|
|
|
|
+ if (role == RoleScript || role == RoleProject) {
|
|
|
|
+ this->AddScriptingCommands();
|
|
|
|
+ }
|
|
|
|
+ if (role == RoleProject) {
|
|
|
|
+ this->AddProjectCommands();
|
|
|
|
+ }
|
|
|
|
|
|
// Make sure we can capture the build tool output.
|
|
// Make sure we can capture the build tool output.
|
|
cmSystemTools::EnableVSConsoleOutput();
|
|
cmSystemTools::EnableVSConsoleOutput();
|
|
@@ -1888,7 +1892,7 @@ int cmake::CheckBuildSystem()
|
|
|
|
|
|
// Read the rerun check file and use it to decide whether to do the
|
|
// Read the rerun check file and use it to decide whether to do the
|
|
// global generate.
|
|
// global generate.
|
|
- cmake cm;
|
|
|
|
|
|
+ cmake cm(RoleScript); // Actually, all we need is the `set` command.
|
|
cm.SetHomeDirectory("");
|
|
cm.SetHomeDirectory("");
|
|
cm.SetHomeOutputDirectory("");
|
|
cm.SetHomeOutputDirectory("");
|
|
cm.GetCurrentSnapshot().SetDefaultDefinitions();
|
|
cm.GetCurrentSnapshot().SetDefaultDefinitions();
|
|
@@ -2419,6 +2423,9 @@ int cmake::Build(const std::string& dir, const std::string& target,
|
|
std::string homeOutputOrig = this->GetHomeOutputDirectory();
|
|
std::string homeOutputOrig = this->GetHomeOutputDirectory();
|
|
this->SetDirectoriesFromFile(cachePath.c_str());
|
|
this->SetDirectoriesFromFile(cachePath.c_str());
|
|
|
|
|
|
|
|
+ this->AddScriptingCommands();
|
|
|
|
+ this->AddProjectCommands();
|
|
|
|
+
|
|
int ret = this->Configure();
|
|
int ret = this->Configure();
|
|
if (ret) {
|
|
if (ret) {
|
|
cmSystemTools::Message("CMake Configure step failed. "
|
|
cmSystemTools::Message("CMake Configure step failed. "
|